[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-bugs-dist
Subject: [umbrello] [Bug 351103] Umbrello crashes when changing type for an operation for a class
From: Oliver Kellogg <okellogg () users ! sourceforge ! net>
Date: 2015-08-14 21:54:39
Message-ID: bug-351103-17878-FCK65knrWA () http ! bugs ! kde ! org/
[Download RAW message or body]
https://bugs.kde.org/show_bug.cgi?id=351103
Oliver Kellogg <okellogg@users.sourceforge.net> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |okellogg@users.sourceforge.
| |net
--- Comment #7 from Oliver Kellogg <okellogg@users.sourceforge.net> ---
(In reply to Challistobugs from comment #2)
> [...]
> I was changing the return type of an operation in a class.
Hmm let's see...
CodeMethodBlock inherits from OwnedCodeBlock,
class CodeMethodBlock : public OwnedCodeBlock, [...]
and declares
public slots:
virtual void syncToParent();
However, the actual "connect" of this syncToParent() is not done in
CodeMethodBlock but rather in the parent class OwnedCodeBlock,
void OwnedCodeBlock::initFields(UMLObject * parent)
{
[...]
connect(m_parentObject, SIGNAL(modified()), this,
SLOT(syncToParent()));
}
The problem is that OwnedCodeBlock::initFields() is called from within the
OwnedCodeBlock constructor,
OwnedCodeBlock::OwnedCodeBlock (UMLObject * parent)
: QObject (parent)
{
setObjectName(QLatin1String("anOwnedCodeBlock"));
initFields(parent);
}
which itself is called by the CodeMethodBlock constructor,
CodeMethodBlock::CodeMethodBlock(ClassifierCodeDocument * doc, UMLObject *
parentObj,
const QString & body, const QString
& comment)
: OwnedCodeBlock (parentObj), [...]
which means that the connect() is done on a CodeMethodBlock object which itself
is not yet fully constructed: vtbl_ptr not yet initialized, dynamic method
dispatch to child class not possible.
By the way, the new code generators had this design error all over the place.
Years ago, I tried to fix the many occurrences of this pattern but gave up at
some point.
--
You are receiving this mail because:
You are watching all bug changes.
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic