diff --git a/source/gui/detail/window_register.hpp b/source/gui/detail/window_register.hpp index 65ac0fa8..40b2fae6 100644 --- a/source/gui/detail/window_register.hpp +++ b/source/gui/detail/window_register.hpp @@ -111,6 +111,15 @@ namespace nana public: using window_handle_type = basic_window*; + ~window_register() + { + //Deleting a basic_window if thread never called exec(), the basic_window object + //will always stay in trash. + // + //Empty the trash before destructs window register + delete_trash(0); + } + void insert(window_handle_type wd) { if (wd)