fix issue that umake_event causes memory leak

This commit is contained in:
Jinhao
2017-02-24 21:16:37 +08:00
parent 66be23c920
commit 00d2e5408f

View File

@@ -80,7 +80,6 @@ namespace nana
internal_scope_guard lock; internal_scope_guard lock;
if (dockers_) if (dockers_)
{ {
for (auto i = dockers_->begin(), end = dockers_->end(); i != end; ++i) for (auto i = dockers_->begin(), end = dockers_->end(); i != end; ++i)
{ {
if (reinterpret_cast<detail::docker_interface*>(evt) == *i) if (reinterpret_cast<detail::docker_interface*>(evt) == *i)
@@ -92,7 +91,11 @@ namespace nana
deleted_flags_ = true; deleted_flags_ = true;
} }
else else
{
bedrock::instance().evt_operation().cancel(evt);
dockers_->erase(i); dockers_->erase(i);
delete reinterpret_cast<detail::docker_interface*>(evt);
}
break; break;
} }
} }