how the pulgin knows the end of main window

Feel free to ask any question here
Post Reply
lmh
Posts: 2
Joined: Fri Aug 12, 2022 3:28 am

how the pulgin knows the end of main window

Post 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!
daniel
Site Admin
Posts: 7710
Joined: Wed Oct 13, 2010 7:34 am
Location: Grenoble, France
Contact:

Re: how the pulgin knows the end of main window

Post 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
Daniel, CloudCompare admin
Post Reply