Ownership fix for QtChildEvent
When created using initWithType🧒, it should take ownership of the
underlying QChildEvent.
This commit is contained in:
parent
daa49494d4
commit
97c281547c
2 changed files with 6 additions and 2 deletions
|
@ -24,7 +24,7 @@ HEADERS += common/helpers.h \
|
|||
|
||||
SOURCES += common/OFString+QString.mm \
|
||||
QtCore/QtChildEvent.mm \
|
||||
QtCore/QtCoreApplication.mm \
|
||||
QtCore/QtCoreApplication.mm \
|
||||
QtCore/QtEvent.mm \
|
||||
QtCore/QtObject.mm \
|
||||
QtCore/QtThread.mm \
|
||||
|
|
|
@ -16,8 +16,12 @@
|
|||
child: (QtObject*)child
|
||||
{
|
||||
try {
|
||||
return [self initWithQChildEvent:
|
||||
self = [self initWithQChildEvent:
|
||||
new QChildEvent(type, [child qObject])];
|
||||
|
||||
[self takeOwnership];
|
||||
|
||||
return self;
|
||||
} catch (const std::bad_alloc &e) {
|
||||
self = [super initWithQEvent: NULL];
|
||||
[self release];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue