From c1a0ebb725d6ac05e94cc6ad8507106636b63326 Mon Sep 17 00:00:00 2001 From: Craig Robbins Date: Sun, 1 May 2016 16:47:08 +1000 Subject: [PATCH] Fix use of uninitialised variable in class Event --- src/threading/event.cpp | 9 ++++++--- src/threading/event.h | 2 +- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/threading/event.cpp b/src/threading/event.cpp index c3c2ca029..b7f16154e 100644 --- a/src/threading/event.cpp +++ b/src/threading/event.cpp @@ -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 diff --git a/src/threading/event.h b/src/threading/event.h index 43f2b04be..dd5164576 100644 --- a/src/threading/event.h +++ b/src/threading/event.h @@ -48,8 +48,8 @@ DEALINGS IN THE SOFTWARE. */ class Event { public: -#if __cplusplus < 201103L Event(); +#if __cplusplus < 201103L ~Event(); #endif void wait();