Dimitry Sibiryakov wrote 21.01.2022 21:19:
initialization in the entry point and finalization in doCleanup for all plugin-related things and initialization in constructor and finalization in destructor for every library-related things should be the right behavior for every plugin including engine itself.

  In addition, not directly related to subj:

If client library was copied with different name and both libraries loaded into the same application (nothing unusual for IBExpert for example), sequence of events in a plugin may be following:

1) Global constructors
2) Entry point from plugin manager 1
3) Entry point from plugin manager 2
4) doCleanup from plugin manager 2
5) Global destructors
6) doCleanup from plugin manager 1

  Two issues are here:

a) If (as per every example and engine code itself) master interface is cached in a global variable, then starting from 3) the plugin's methods, called from library 1 will use wrong master interface.
b) After 4) the cached pointer is invalid and if used may lead to crash.

--
  WBR, SD.


Firebird-Devel mailing list, web interface at 
https://lists.sourceforge.net/lists/listinfo/firebird-devel

Reply via email to