View Full Version : library cleanup API

08-10-2009, 02:57 PM
the FlexNet documentation (FuncRef-c) mentions that flxActCommonLibraryCleanup() returns a FlxActBool based on if the call succeeded or not while the header file declares this function as returning void
can you confirm which one is correct? I'm assuming the documentation is correct since it mentions calling this function only if a previous call to flxActCommonLibraryInit succeeded

without a return type there wouldn't be a way to know whether the cleanup succeeded or not

08-11-2009, 08:22 PM
The header file might be correct: with the nearly equivalent (to flxActCommonLibraryInit and -LibraryCleanup) functions lc_flexinit and lc_flexinit_cleanup, the latter does return an error value, but the only thing documented to go wrong is an invalid property handle; and only lc_flexinit (as opposed to flxActCommonLibraryInit) takes the handle argument...

08-12-2009, 03:50 PM
thanks it makes sense now. Had another question along similar lines

I close the flex handle (flxActCommonHandleClose) and then call the lib cleanup flxActCommonLibraryCleanup. In case closing the handle fails should I still be calling cleanup? and if I do would that lead to any kind of leak?

08-13-2009, 04:25 PM
The documentation suggests that flxActCommonLibraryCleanup frees resources beyond the FlxActHandle, so I expect you should still call -LibraryCleanup if -HandleClose fails (which should be unlikely).

08-13-2009, 06:51 PM
ok. that's what I was currently doing. Just wanted to make sure I wasn't doing it wrong