How to correctly kill plugins with their windows?
-
Main application loads bunch of plugins. Most of them have their own UIs and windows appear on screen. When application ends I have close all plugins window and kill all plugins threads if any running. I'm thinking how better do that... As I see - when I close main app window but plugins window exist (even one) - then application is still running. Probably all loaded plugins run too. All finishes when I close last window regardless of is it main window or plugin window. I'm going create a set of slots in plugins to connect them to on_MainWindow_destroyed() signals. And connect them between plugins to allow any of them close others. But I'm not sure - will this correctly close application and destroy all plugins when last window close? Anybody can comment this?