fix a crash that caused by double-delete of a event handler

This commit is contained in:
Jinhao
2015-05-01 16:29:51 +08:00
parent f943673d3d
commit a64354900c
9 changed files with 144 additions and 102 deletions

View File

@@ -356,7 +356,6 @@ namespace nana
effect.bground_fade_rate = 0;
together.caret = nullptr;
together.attached_events = nullptr;
extra_width = extra_height = 0;
@@ -369,16 +368,15 @@ namespace nana
bool basic_window::set_events(const std::shared_ptr<general_events>& p)
{
if (together.attached_events)
if (together.events_ptr)
return false;
together.events_ptr = p;
together.attached_events = p.get();
return true;
}
general_events * basic_window::get_events() const
{
return together.attached_events;
return together.events_ptr.get();
}
//end struct basic_window
}//end namespace detail