Bug 122914 - crash when refusing to rename a class on importing typedef
Summary: crash when refusing to rename a class on importing typedef
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Compiled Sources Linux
: NOR crash
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-03-01 20:02 UTC by Yan Morin
Modified: 2006-03-02 00:22 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Yan Morin 2006-03-01 20:02:14 UTC
Version:            (using KDE KDE 3.5.1)
Installed from:    Compiled From Sources
OS:                Linux

There is a bug in umbrello on Cpp Import with Template + typedef that produce another bug when importing twice a file.

cpptree2uml.cpp:155
The typedef importation tries to create the typedef inner class.

It uses Import_Utils::createUMLObject() and doesn't see the bad templated datatype and think that the function has to create it. 

It tries to create it, and then it sees that the templated datatype already exists, so it wants to rename it. 

The user say 'no', return 0, and then bang! umbrello crashes because it uses a 0 pointer.
It crashes after import_utils.cpp:189

Easy test.h file:

namespace test {
 typedef std::map<std::string, ItemMap*> SectionMap;
 typedef std::map<std::string, SectionMap*> SectionMapMap;
}

Import this file two times, and say no to the 'rename' dialog.
Comment 1 Oliver Kellogg 2006-03-02 00:22:55 UTC
SVN commit 514932 by okellogg:

Prevent crashing as described in the PR - but there is still some uncertainty
concerning where to put imported data types (global vs local scope)
BUG:122914


 M  +1 -0      ChangeLog  
 M  +4 -6      umbrello/import_utils.cpp  
 M  +6 -4      umbrello/model_utils.cpp  
 M  +52 -39    umbrello/object_factory.cpp  
 M  +7 -1      umbrello/object_factory.h