[ruamoko] Own created property list objects

If the PLItem classes create a property list object, they own it. Plugs
more leaks.
This commit is contained in:
Bill Currie 2023-03-04 00:39:37 +09:00
parent e57427142b
commit 8b8bc42038

View file

@ -51,12 +51,16 @@
+ (PLItem *) fromString:(string) str + (PLItem *) fromString:(string) str
{ {
return [[PLItem itemClass: PL_GetPropertyList (str)] autorelease]; PLItem *item = [[PLItem itemClass: PL_GetPropertyList (str)] autorelease];
item.own = 1;
return item;
} }
+ (PLItem *) fromFile:(QFile) file + (PLItem *) fromFile:(QFile) file
{ {
return [[PLItem itemClass: PL_GetFromFile (file)] autorelease]; PLItem *item = [[PLItem itemClass: PL_GetFromFile (file)] autorelease];
item.own = 1;
return item;
} }
- initWithItem:(plitem_t *) item - initWithItem:(plitem_t *) item
@ -211,7 +215,9 @@
- (PLItem *) allKeys - (PLItem *) allKeys
{ {
return [[PLItem itemClass: PL_D_AllKeys (item)] autorelease]; PLItem *item = [[PLItem itemClass: PL_D_AllKeys (item)] autorelease];
item.own = 1;
return item;
} }
- addKey:(string) key value:(PLItem *) value - addKey:(string) key value:(PLItem *) value