From ebce540dfcc8380c04e165775ef45bdf376a5d7f Mon Sep 17 00:00:00 2001 From: Paul Cercueil Date: Fri, 19 Jul 2013 14:29:51 -0400 Subject: [PATCH] Exit the thread properly in the destructor of Monitor objects --- src/monitor.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/monitor.cpp b/src/monitor.cpp index 631d931..ca3b24e 100644 --- a/src/monitor.cpp +++ b/src/monitor.cpp @@ -91,6 +91,7 @@ Monitor::Monitor(std::string path, unsigned int flags) : path(path) Monitor::~Monitor(void) { - pthread_kill(thd, SIGINT); + pthread_cancel(thd); + pthread_join(thd, NULL); } #endif