Pete,
I know this is a pain for you. It’s something I’ve done some work on, but there are some big architectural things that make it difficult to get this working how you want. Right now, the only solution I know of is to use an exit handler (see ‘man atexit’ for more info) when the app quits and release all remaining licenses that you’re holding on to. (Which, if I recall is already what you’re doing, isn’t it?)
Darrin On May 22, 2017, at 4:29 PM, Peter Litwinowicz < email@hidden> wrote:
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
-- Daniel Walz | Software Developer
Filmstro | Music that Moves.
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
|