Bug 122668 - memory problem when importing classes from c++ sources
Summary: memory problem when importing classes from c++ sources
Status: RESOLVED FIXED
Alias: None
Product: umbrello
Classification: Applications
Component: general (show other bugs)
Version: unspecified
Platform: Gentoo Packages Linux
: NOR crash
Target Milestone: ---
Assignee: Umbrello Development Group
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-02-25 01:12 UTC by timblechmann
Modified: 2006-03-26 16:29 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
example header file (14.04 KB, text/plain)
2006-02-25 01:13 UTC, timblechmann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description timblechmann 2006-02-25 01:12:42 UTC
Version:            (using KDE KDE 3.5.1)
Installed from:    Gentoo Packages
Compiler:          gcc-3.4.5 
OS:                Linux

when importing classes from this header file, umbrello is killed by the operating system, because of extensive memory usage (about 1.2 gb)...

i've attached the specific header, i hope, that is helping you to track down the problem ...
Comment 1 timblechmann 2006-02-25 01:13:30 UTC
Created attachment 14858 [details]
example header file
Comment 2 Oliver Kellogg 2006-02-27 21:25:48 UTC
Doesn't happen for me with branches/KDE/3.5 of today, probably was fixed by http://www.geeksoc.org/~jr/umbrello/uml-devel/att-9259/umbrello-isDatatype.patch
Comment 3 Oliver Kellogg 2006-03-26 11:40:52 UTC
Doh, I don't know how this could work for me.
You are right, it's an open bug.
Comment 4 Oliver Kellogg 2006-03-26 16:29:53 UTC
SVN commit 522714 by okellogg:

findUMLObject(): Detect name match with a surrounding scope proper.
(The problem is triggered by the declaration "friend class RedBlackTree;"
int the nested class "iterator" of the p_tree.hpp attachment.)
BUG:122668


 M  +1 -1      ChangeLog  
 M  +8 -0      umbrello/model_utils.cpp  


--- branches/KDE/3.5/kdesdk/umbrello/ChangeLog #522713:522714
@@ -5,6 +5,7 @@
 * Static variables in java code are not marked static (59190)
 * Save autosave file to a more obvious place (72019)
 * Usability and responsiveness improvements to code import (93296)
+* Memory problem when importing classes from c++ sources (122668)
 
 Version 1.5.2
 
@@ -32,7 +33,6 @@
 * Crash when importing Python files (121952)
 * "void" is imported as class and not datatypes (122184)
 * Crash when creating a datatype with the same name as a class (122188)
-* Memory problem when importing classes from c++ sources (122668)
 * Crash when refusing to rename a class on importing typedef (122914)
 * Java import fails at abstract methods or interfaces (123661)
 
--- branches/KDE/3.5/kdesdk/umbrello/umbrello/model_utils.cpp #522713:522714
@@ -139,6 +139,14 @@
         // Remember packages that we've seen - for avoiding cycles.
         UMLPackageList seenPkgs;
         for (; pkg; pkg = currentObj->getUMLPackage()) {
+            if (nameWithoutFirstPrefix.isEmpty()) {
+                if (caseSensitive) {
+                    if (pkg->getName() == name)
+                        return pkg;
+                } else if (pkg->getName().lower() == name.lower()) {
+                    return pkg;
+                }
+            }
             if (seenPkgs.findRef(pkg) != -1) {
                 kdError() << "findUMLObject(" << name << "): "
                 << "breaking out of cycle involving "