Index: ObjQt.pro ================================================================== --- ObjQt.pro +++ ObjQt.pro @@ -22,11 +22,11 @@ QtWidgets/QtApplication.h \ QtWidgets/QtWidget.h SOURCES += common/OFString+QString.mm \ QtCore/QtChildEvent.mm \ - QtCore/QtCoreApplication.mm \ + QtCore/QtCoreApplication.mm \ QtCore/QtEvent.mm \ QtCore/QtObject.mm \ QtCore/QtThread.mm \ QtGui/QtGuiApplication.mm \ QtGui/QtPaintDevice.mm \ Index: QtCore/QtChildEvent.mm ================================================================== --- QtCore/QtChildEvent.mm +++ QtCore/QtChildEvent.mm @@ -14,12 +14,16 @@ - initWithType: (QChildEvent::Type)type 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]; throw; }