gajeshm
Level 3

multiple calls to flxActCommonLibraryInit

Hello,

How should we call "flxActCommonLibraryInit"  and "flxActCommonLibraryCleanup" in a way so that multiple calls to this function won't cause any issue?

Document says that these function should be called once only in an application but I am facing issues where I have provided API library which uses Flex lib and make call to these functions. This API library can be consumed by many components which may or may not belong to same application. 

How this problem can be addressed?

Regards,

Gajesh

Labels (1)
0 Kudos
3 Replies
aparashar1
Flexera Alumni

Dear @gajeshm , we are working with engineering to get some guidance on this concern. Internal Cae # 02271497.

In general i would expect the module calling "flxActCommonLibraryInit()" to ensure it also calls "flxActCommonLibraryCleanup()" by the end of same module. However, as you have mentioned for cases of interconnected module calls i.e. 

Mod 1 launched -> flxActCommonLibraryInit() called -> Internally it calls Mod X -> Inside Mod X we have a call for 'flxActCommonLibraryInit' --> This is the concern, right?

If so, then let me get back to you via support case with proposed inputs from engineering.

(If my response assists with your questions , then please click "ACCEPT AS SOLUTION" or 'Kudos' so that it help others.)
0 Kudos

flxActCommonLibraryInit() and flxActCommonLibraryCleanup() are idempotent rather than reference counted.

The Module 1's call (the first method being called) to flxActCommonLibraryInit() will perform the initialization of the Activation API and any subsequent call of flxActCommonLibraryInit() by ModX will have no effect and will simply return without error.

Similarly for flxActCommonLibraryCleanup(), the first call (presumably by Mod-X) will perform a cleanup of Activation API resources and any subsequent call to flxActCommonLibraryCleanup() by calling functions will have no effect.

It is important to note that, Module 1 must not make any calls to the Activation API after Mod-X has called flxActCommonLibraryCleanup() (except to flxActCommonLibraryCleanup() itself).

(If my response assists with your questions , then please click "ACCEPT AS SOLUTION" or 'Kudos' so that it help others.)
0 Kudos
baudewijn_verm
Level 4

Adapt you library so that init is called only once.

The restriction is for single app only. There is no problem running multiple applications.

0 Kudos