Hello,
I wrote a QC plugin that has NSDictionary input port.
I use this plugin from application with enabled garbage collection.
Very rarely, a crash occurs. The plugin has execution mode
kQCPlugInExecutionModeProcessor and kQCPlugInTimeModeTimeBase time mode. It is
executed very often (multiple times per second) and it may take minutes,
sometimes maybe even hours for the crash to occur.
It seems that the crash only occurs on change of the NSDictionary input port
(it never seems to crash when the execution is time-triggered). Even when
changing the input port very often, it sometimes take very long time to crash.
It seems like the input port object has already been deallocated when the crash
occurs and I try to use it in execute: atTime:withArguments: method. I came to
this conclusion because in this situation, I get EXC_BAD_ACCESS when trying to
call valueForKey: method on input port dictionary.
Once, Xcode debugger showed me this error:
resurrection error for object 0x158dbe0 while assigning
{conservative-block}[32](0x139a890)[0] = NSCFDictionary[48](0x158dbe0)
garbage pointer stored into reachable memory, break on
auto_zone_resurrection_error to debug
objc[17599]: **resurrected** object 0x158dbe0 of class NSCFDictionary being
sent message 'getGraphicObjects'
objc[17599]: **resurrected** object 0x158dbe0 of class NSCFDictionary being
sent message 'count'
...
"graphicObjects" is one of the keys deep in the input port dictionary (the
dictionary contains other dictionaries, strings and nsnumbers).
The NSDictionary input port is declared in the plugin as
@property(assign) NSDictionary* inputTimeLines;
I also tried:
@property(copy) NSDictionary* inputTimeLines;
but the crashes kept occurring (side question: what is the correct property
form for QC plugin structure input ports??)
I came to the conclusion that this is some garbage collector related problem,
and the provided dictionary is, from time-to-time, somehow freed before or
during the execution of the plugin.
The plugin project has the Objective-C Garbage Collection setting set as
"Supported [-fobjc-gc]". The application requires GC.
Did somebody encounter similar problem?
Because the crash occurs so rarely, it is quite hard to work around (or fix) it
properly.
Any suggestions will be greatly appreciated.
Thanks,
Miso
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Quartzcomposer-dev mailing list ([email protected])
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/quartzcomposer-dev/archive%40mail-archive.com
This email sent to [email protected]