Fix use of uninitialised variable in class Event
authorCraig Robbins <kde.psych@gmail.com>
Sun, 1 May 2016 06:47:08 +0000 (16:47 +1000)
committerCraig Robbins <kde.psych@gmail.com>
Sun, 1 May 2016 07:32:00 +0000 (17:32 +1000)
src/threading/event.cpp
src/threading/event.h

index c3c2ca029e4f45abf8a9bbad2f22a4ba6921e2d3..b7f16154ebc946e3d55cc9f2af6b8b9a0e45f5c7 100644 (file)
@@ -25,17 +25,20 @@ DEALINGS IN THE SOFTWARE.
 
 #include "threading/event.h"
 
-#if __cplusplus < 201103L
 Event::Event()
+    : notified(false)
 {
-#ifdef _WIN32
+#if __cplusplus < 201103L
+#      ifdef _WIN32
        event = CreateEvent(NULL, false, false, NULL);
-#else
+#      else
        pthread_cond_init(&cv, NULL);
        pthread_mutex_init(&mutex, NULL);
+#      endif
 #endif
 }
 
+#if __cplusplus < 201103L
 Event::~Event()
 {
 #ifdef _WIN32
index 43f2b04bed793c8db44b35e2fcbe29c694a7a0fd..dd51645767aa57544260f1138dd07c93aa5b15d8 100644 (file)
@@ -48,8 +48,8 @@ DEALINGS IN THE SOFTWARE.
  */
 class Event {
 public:
-#if __cplusplus < 201103L
        Event();
+#if __cplusplus < 201103L
        ~Event();
 #endif
        void wait();