On 7/13/21 6:32 PM, Dimitry Sibiryakov wrote:
Hello All.

  Is doClean() supposed to be guaranteed to be called before plugin library unloading process?

  For Firebird 4 (current snapshot) in embedded I see that it is called after some global variables of the library are already destructed, i.e. it is either called from DLLMain or we have thread races and shutdown thread is calling functions of already unloaded DLL.


excuse me if I'm missing something - many time has passed since I used to work with this particular code

doClean() may be called for 2 reasons:
- Plugin Manager is going to unload your module, in this case all globals should be OK - your process called exit() and due to it plugin is going to be unloaded, this fact is detected by dtor of UnloadDetectorHelper, which also calls doClean, but in this case some globals may be already destroyed, you need to manually control order of destruction in your plugin to avoid this




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

Reply via email to