From 00d2e5408f7a1ec6aa60289ec455d5738c8637b2 Mon Sep 17 00:00:00 2001 From: Jinhao Date: Fri, 24 Feb 2017 21:16:37 +0800 Subject: [PATCH] fix issue that umake_event causes memory leak --- source/gui/detail/events_operation.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/gui/detail/events_operation.cpp b/source/gui/detail/events_operation.cpp index bcafd688..55c4234d 100644 --- a/source/gui/detail/events_operation.cpp +++ b/source/gui/detail/events_operation.cpp @@ -80,7 +80,6 @@ namespace nana internal_scope_guard lock; if (dockers_) { - for (auto i = dockers_->begin(), end = dockers_->end(); i != end; ++i) { if (reinterpret_cast(evt) == *i) @@ -92,7 +91,11 @@ namespace nana deleted_flags_ = true; } else + { + bedrock::instance().evt_operation().cancel(evt); dockers_->erase(i); + delete reinterpret_cast(evt); + } break; } }