[Uml-devel] KDE/kdesdk/umbrello/umbrello

Oliver Kellogg okellogg at users.sourceforge.net
Wed Jul 4 22:48:33 UTC 2007


SVN commit 683555 by okellogg:

setDefaults(bool): We cannot call the setIndentation methods when being
called by the constructor because they call calculateIndentation() at a
time when not all data was initialized yet:

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 1107416192 (LWP 14039)]
0x400a9bb5 in QString::append (this=0x847c8c0, str=@0xbfffeba8) at tools/qstring.cpp:1248
1248                d->data[d->size] = '\0';
(gdb) bt
#0  0x400a9bb5 in QString::append (this=0x847c8c0, str=@0xbfffeba8) at tools/qstring.cpp:1248
#1  0x08080070 in QString::operator+= (this=0x847c8c0, s=@0xbfffeba8) at /usr/local/Trolltech/Qt-4.3.0/include/QtCore/qstring.h:227
#2  0x0820cd98 in CodeGenerationPolicy::calculateIndentation (this=0x847c880)
    at /kdesdk/umbrello/umbrello/codegenerationpolicy.cpp:299
#3  0x0820cdfc in CodeGenerationPolicy::setIndentationType (this=0x847c880, new_var=CodeGenerationPolicy::SPACE)
    at /kdesdk/umbrello/umbrello/codegenerationpolicy.cpp:254
#4  0x0820d208 in CodeGenerationPolicy::setDefaults (this=0x847c880, emitUpdateSignal=false)
    at /kdesdk/umbrello/umbrello/codegenerationpolicy.cpp:412
#5  0x0820d783 in CodeGenerationPolicy (this=0x847c880) at /kdesdk/umbrello/umbrello/codegenerationpolicy.cpp:59
#6  0x0827d1ef in UMLApp (this=0x84434a8, parent=0x0) at /kdesdk/umbrello/umbrello/uml.cpp:165
#7  0x082435d0 in main (argc=137559916, argv=0x84436d8) at /kdesdk/umbrello/umbrello/main.cpp:95
(gdb) p d->size
$2 = 268437491


 M  +2 -3      codegenerationpolicy.cpp  


--- trunk/KDE/kdesdk/umbrello/umbrello/codegenerationpolicy.cpp #683554:683555
@@ -409,9 +409,8 @@
     setCodeVerboseDocumentComments(UmbrelloSettings::forceDoc());
     setCodeVerboseSectionComments(UmbrelloSettings::forceSections());
     setLineEndingType(UmbrelloSettings::lineEndingType());
-    setIndentationType(UmbrelloSettings::indentationType());
-    setIndentationAmount(UmbrelloSettings::indentationAmount());
-
+    m_indentationType = UmbrelloSettings::indentationType();
+    m_indentationAmount = UmbrelloSettings::indentationAmount();
     calculateIndentation();
 
     QString path = UmbrelloSettings::outputDirectory();




More information about the umbrello-devel mailing list