From aab3686037b41a8f3807166e9d5b4581adcb4c67 Mon Sep 17 00:00:00 2001 From: Jinhao Date: Thu, 4 May 2017 04:00:19 +0800 Subject: [PATCH] fix issue that basic_window may be leaked --- source/gui/detail/window_register.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) 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)