Re: dealloc not called for FxPlug
Re: dealloc not called for FxPlug
- Subject: Re: dealloc not called for FxPlug
- From: Peter Litwinowicz <email@hidden>
- Date: Mon, 22 May 2017 16:29:56 -0700
- Thread-topic: dealloc not called for FxPlug
Darrin,
During shutdown, the apps do not free every piece of memory that they allocated.
I've asked before and have filed bug reports: –dealloc was NOT be called on the apiManager object for each time initWithAPIManager invocation.
I complained because we were not having all resource management code being called properly. In particular we needed to tell our floating license server (in another process) to release any licenses upon exit, which can only be done by a deallocation of the apiManager object we create for our plug-in (and needs to be done for each invocation of initWithApiManager for a balanced set of calls).
So not calling –dealloc on our apiManager object doesn't give us this chance to setup and release our licenses in a balanced way.
So what is the proposed proper way for us to "undo" what we did in "init" in a balanced way?
Pete
Daniel,
You should not directly call -dealloc on your ThemeLibrary object. You should call -release. It probably won’t cause any problems, but it could in theory.
That said, what you are seeing is normal. During shutdown, the apps do not free every piece of memory that they allocated. Since the operating system will free all memory used by the app’s process, the apps just quit and let the OS reclaim the memory rather than manually going through every object and deallocating them. This significantly speeds up shutdown times for users.
Darrin On May 22, 2017, at 5:47 AM, Daniel Walz < email@hidden> wrote:
Hi everybody,
I have a FxGenerator plugin and I allocate a C++ class in the init method. I test that in a project with one instance on the timeline. I get two calls to init (using NSLog debugging), but only one dealloc when closing Final Cut, hence my LeakDetector goes off.
Maybe it is due to my limited ObjC knowledge, this is my first ObjC project...
Is there something I did wrong? Or is it a FinalCut mistake?
Here is the relevant code:
- (id)initWithAPIManager:(id)apiManager { (void)@protocol(MyFxPlugRegistration); self = [super init];
_apiManager = apiManager; _registeredPlugin = YES;
themeLibrary = [[ThemeLibrary alloc] init]; NSLog (@"created MyFxPlug"); return self; }
- (void)dealloc { NSLog (@"dealloc MyFxPlug"); // Clean up [themeLibrary dealloc]; [super dealloc]; }
Thanks for helping,
Daniel
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list ( email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden
|
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Pro-apps-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden