From e7ce506f5a1d95ed63bb3565c456716618887a6a Mon Sep 17 00:00:00 2001 From: Jinhao Date: Wed, 19 Oct 2016 04:01:40 +0800 Subject: [PATCH] fix an exception of msg_dispatcher --- source/detail/x11/msg_dispatcher.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/source/detail/x11/msg_dispatcher.hpp b/source/detail/x11/msg_dispatcher.hpp index 2f1688e0..77f43a18 100644 --- a/source/detail/x11/msg_dispatcher.hpp +++ b/source/detail/x11/msg_dispatcher.hpp @@ -58,6 +58,15 @@ namespace detail 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) { proc_.timer_proc = timer_proc;