Page 1 of 1

how the pulgin knows the end of main window

Posted: Fri Aug 12, 2022 4:32 am
by lmh
hi all,
I am learning how to write plugins. I created a modeless dialog in the plugin class and destroyed it in the plugin class's destructor. I would expect the plugin class's destructor to be called when the user closes the main program, but it looks like it doesn't. I debugged the qpcl plugin and it seems to be the same. So, as a plug-in, how do you know that the main program is about to be closed?
Thanks a lot!

Re: how the pulgin knows the end of main window

Posted: Sun Aug 14, 2022 8:30 am
by daniel
On my side (Windows) plugin destructors are called after CloudCompare exits (at the very end of the main.cpp process, when the application returns).

But before that, the 'stop' function is called on all plugins. You could use this mechanism to trigger something when CC exits.
https://github.com/CloudCompare/CloudCo ... n.cpp#L285