| Summary: | crash on exit after loading XMI file with Advanced Code Generators enabled | ||
|---|---|---|---|
| Product: | [Applications] umbrello | Reporter: | Oliver Kellogg <okellogg> |
| Component: | general | Assignee: | Oliver Kellogg <okellogg> |
| Status: | RESOLVED FIXED | ||
| Severity: | crash | ||
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Compiled Sources | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | 4.0.0 | |
| Sentry Crash Report: | |||
| Attachments: | phonon-design-saved-by-trunk-r707383.xmi | ||
|
Description
Oliver Kellogg
2007-09-01 20:20:40 UTC
Created attachment 21526 [details]
phonon-design-saved-by-trunk-r707383.xmi
XMI file for which the crash-on-exit happens.
Call of reimplementred virtual functions during object construction, as usual :( See also bug 84739 and bug 126262 SVN commit 707609 by okellogg: Remove calls to reimplemented virtual functions from within constructors of advanced code generator classes. BUG:149457 M +1 -0 ChangeLog.2 M +2 -2 umbrello/classifiercodedocument.h M +2 -2 umbrello/codeaccessormethod.h M +6 -4 umbrello/codeclassfield.h M +8 -8 umbrello/codeclassfielddeclarationblock.h M +10 -6 umbrello/codedocument.h M +31 -8 umbrello/codegenerators/codegenfactory.cpp M +0 -3 umbrello/codegenerators/cppheaderclassdeclarationblock.cpp M +5 -5 umbrello/codegenerators/cppheaderclassdeclarationblock.h M +0 -2 umbrello/codegenerators/cppheadercodeaccessormethod.h M +0 -1 umbrello/codegenerators/cppheadercodeclassfielddeclarationblock.cpp M +3 -3 umbrello/codegenerators/cppheadercodeclassfielddeclarationblock.h M +3 -0 umbrello/codegenerators/cppheadercodedocument.cpp M +2 -2 umbrello/codegenerators/cppheadercodedocument.h M +0 -4 umbrello/codegenerators/cppheadercodeoperation.cpp M +2 -2 umbrello/codegenerators/cppheadercodeoperation.h M +0 -2 umbrello/codegenerators/cppsourcecodeaccessormethod.h M +0 -1 umbrello/codegenerators/cppsourcecodeclassfielddeclarationblock.cpp M +3 -3 umbrello/codegenerators/cppsourcecodeclassfielddeclarationblock.h M +5 -6 umbrello/codegenerators/cppsourcecodedocument.cpp M +2 -2 umbrello/codegenerators/cppsourcecodedocument.h M +0 -64 umbrello/codegenerators/cppsourcecodeoperation.cpp M +0 -2 umbrello/codegenerators/cppsourcecodeoperation.h M +0 -2 umbrello/codegenerators/dclassdeclarationblock.cpp M +5 -5 umbrello/codegenerators/dclassdeclarationblock.h M +1 -0 umbrello/codegenerators/dclassifiercodedocument.cpp M +2 -2 umbrello/codegenerators/dclassifiercodedocument.h M +3 -3 umbrello/codegenerators/dcodeaccessormethod.h M +0 -1 umbrello/codegenerators/dcodeclassfielddeclarationblock.cpp M +3 -3 umbrello/codegenerators/dcodeclassfielddeclarationblock.h M +0 -3 umbrello/codegenerators/dcodeoperation.cpp M +0 -3 umbrello/codegenerators/javaclassdeclarationblock.cpp M +0 -2 umbrello/codegenerators/javaclassdeclarationblock.h M +1 -0 umbrello/codegenerators/javaclassifiercodedocument.cpp M +2 -2 umbrello/codegenerators/javaclassifiercodedocument.h M +3 -3 umbrello/codegenerators/javacodeaccessormethod.h M +0 -1 umbrello/codegenerators/javacodeclassfielddeclarationblock.cpp M +5 -4 umbrello/codegenerators/javacodeclassfielddeclarationblock.h M +0 -3 umbrello/codegenerators/javacodeoperation.cpp M +0 -3 umbrello/codegenerators/rubyclassdeclarationblock.cpp M +7 -14 umbrello/codegenerators/rubyclassdeclarationblock.h M +1 -0 umbrello/codegenerators/rubyclassifiercodedocument.cpp M +2 -2 umbrello/codegenerators/rubyclassifiercodedocument.h M +5 -8 umbrello/codegenerators/rubycodeaccessormethod.h M +0 -1 umbrello/codegenerators/rubycodeclassfielddeclarationblock.cpp M +3 -3 umbrello/codegenerators/rubycodeclassfielddeclarationblock.h M +0 -4 umbrello/codegenerators/rubycodeoperation.cpp M +7 -7 umbrello/codegenerators/xmlelementcodeblock.h M +7 -6 umbrello/codemethodblock.h M +3 -3 umbrello/codeoperation.h M +2 -2 umbrello/codeparameter.h M +6 -6 umbrello/ownedcodeblock.h M +2 -2 umbrello/ownedhierarchicalcodeblock.h Nope, still not fixed. (I had forgot to reenable advanced code generators.) SVN commit 708118 by okellogg:
UMLDoc::closing(): New. Returns true while closeDocument() executes.
UMLObject::emitModified(): Don't emit modified() if UMLDoc::closing() returns true.
Note that this change only _avoids_ the crash but does not fix the cause which
remains totally obscure to me :( Any help appreciated.
BUG:149457
M +1 -3 association.cpp
M +4 -4 classifier.cpp
M +7 -1 umldoc.cpp
M +10 -0 umldoc.h
M +1 -1 umlobject.cpp
--- trunk/KDE/kdesdk/umbrello/umbrello/association.cpp #708117:708118
@@ -546,9 +546,7 @@
kDebug() << " A new uni-association has been created.";
#endif
}
- UMLDoc *umldoc = UMLApp::app()->getDocument();
- if (! umldoc->loading())
- emit modified();
+ UMLObject::emitModified();
}
void UMLAssociation::setObject(UMLObject *obj, Uml::Role_Type role) {
--- trunk/KDE/kdesdk/umbrello/umbrello/classifier.cpp #708117:708118
@@ -765,7 +765,7 @@
UMLAttribute *retval = dynamic_cast<UMLAttribute*>(m_List.takeAt( index ));
if (retval) {
emit attributeRemoved(retval);
- emit modified();
+ UMLObject::emitModified();
} else {
index = -1;
}
@@ -775,7 +775,7 @@
UMLTemplate *t = dynamic_cast<UMLTemplate*>(m_List.takeAt( index));
if (t) {
emit templateRemoved(t);
- emit modified();
+ UMLObject::emitModified();
} else {
index = -1;
}
@@ -786,7 +786,7 @@
if (el) {
UMLEnum *e = static_cast<UMLEnum*>(this);
e->signalEnumLiteralRemoved(el);
- emit modified();
+ UMLObject::emitModified();
} else {
index = -1;
}
@@ -797,7 +797,7 @@
if (el) {
UMLEntity *e = static_cast<UMLEntity*>(this);
e->signalEntityAttributeRemoved(el);
- emit modified();
+ UMLObject::emitModified();
} else {
index = -1;
}
--- trunk/KDE/kdesdk/umbrello/umbrello/umldoc.cpp #708117:708118
@@ -95,6 +95,7 @@
m_nViewID = Uml::id_None;
m_pTabPopupMenu = 0;
m_pCurrentRoot = NULL;
+ m_bClosing = false;
}
void UMLDoc::init() {
@@ -257,6 +258,7 @@
}
void UMLDoc::closeDocument() {
+ m_bClosing = true;
UMLApp::app()->setGenerator(Uml::pl_Reserved); // delete the codegen
m_Doc = "";
DocWindow* dw = UMLApp::app()->getDocWindow();
@@ -299,6 +301,7 @@
}
*/
}
+ m_bClosing = false;
m_bTypesAreResolved = false;
}
@@ -827,7 +830,6 @@
}
s = new UMLStereotype(name, STR2ID(name));
addStereotype(s);
- //emit modified();
return s;
}
@@ -956,6 +958,10 @@
m_bLoading = state;
}
+bool UMLDoc::closing() const {
+ return m_bClosing;
+}
+
UMLView* UMLDoc::createDiagram(UMLFolder *folder, Uml::Diagram_Type type, bool askForName /*= true */) {
bool ok = true;
QString name,
--- trunk/KDE/kdesdk/umbrello/umbrello/umldoc.h #708117:708118
@@ -701,6 +701,11 @@
void setLoading(bool state = true);
/**
+ * Returns the m_bClosing flag.
+ */
+ bool closing() const;
+
+ /**
* Calls the active code generator to create its default datatypes
*/
void addDefaultDatatypes();
@@ -828,6 +833,11 @@
*/
UMLFolder * m_pCurrentRoot;
+ /**
+ * True while closeDocument() is executing.
+ */
+ bool m_bClosing;
+
public slots:
void slotRemoveUMLObject(UMLObject*o);
--- trunk/KDE/kdesdk/umbrello/umbrello/umlobject.cpp #708117:708118
@@ -244,7 +244,7 @@
void UMLObject::emitModified()
{
UMLDoc *umldoc = UMLApp::app()->getDocument();
- if (! umldoc->loading())
+ if (!umldoc->loading() && !umldoc->closing())
emit modified();
}
set version-fixed-in from 4.0.0 changelog |