fix an exception of msg_dispatcher

This commit is contained in:
Jinhao 2016-10-19 04:01:40 +08:00
parent 9ed5e81ca2
commit e7ce506f5a

View File

@ -58,6 +58,15 @@ namespace detail
proc_.filter_proc = 0; proc_.filter_proc = 0;
} }
~msg_dispatcher()
{
if(thrd_ && thrd_->joinable())
{
is_work_ = false;
thrd_->join();
}
}
void set(timer_proc_type timer_proc, event_proc_type event_proc, event_filter_type filter) void set(timer_proc_type timer_proc, event_proc_type event_proc, event_filter_type filter)
{ {
proc_.timer_proc = timer_proc; proc_.timer_proc = timer_proc;