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
|
@ -16,8 +16,12 @@
|
||||||
child: (QtObject*)child
|
child: (QtObject*)child
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
return [self initWithQChildEvent:
|
self = [self initWithQChildEvent:
|
||||||
new QChildEvent(type, [child qObject])];
|
new QChildEvent(type, [child qObject])];
|
||||||
|
|
||||||
|
[self takeOwnership];
|
||||||
|
|
||||||
|
return self;
|
||||||
} catch (const std::bad_alloc &e) {
|
} catch (const std::bad_alloc &e) {
|
||||||
self = [super initWithQEvent: NULL];
|
self = [super initWithQEvent: NULL];
|
||||||
[self release];
|
[self release];
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue