summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-01-31 13:09:34 +0100
committermadmaxoft@gmail.com <madmaxoft@gmail.com@0a769ca7-a7f5-676a-18bf-c427514a06d6>2012-01-31 13:09:34 +0100
commit154399ccd1d97f0e1ca2bf7b2134bc5e37a94802 (patch)
tree67784c6584e272a62d0a1cfd3bc1c84098f73615
parentcEvent class cleanup (single-event only, since multi-event wasn't used and wouldn't work on *nix anyway) (diff)
downloadcuberite-154399ccd1d97f0e1ca2bf7b2134bc5e37a94802.tar
cuberite-154399ccd1d97f0e1ca2bf7b2134bc5e37a94802.tar.gz
cuberite-154399ccd1d97f0e1ca2bf7b2134bc5e37a94802.tar.bz2
cuberite-154399ccd1d97f0e1ca2bf7b2134bc5e37a94802.tar.lz
cuberite-154399ccd1d97f0e1ca2bf7b2134bc5e37a94802.tar.xz
cuberite-154399ccd1d97f0e1ca2bf7b2134bc5e37a94802.tar.zst
cuberite-154399ccd1d97f0e1ca2bf7b2134bc5e37a94802.zip
Diffstat (limited to '')
-rw-r--r--source/cEvent.cpp3
-rw-r--r--source/cEvent.h1
2 files changed, 3 insertions, 1 deletions
diff --git a/source/cEvent.cpp b/source/cEvent.cpp
index 727cab81c..aee6b866e 100644
--- a/source/cEvent.cpp
+++ b/source/cEvent.cpp
@@ -23,6 +23,7 @@ cEvent::cEvent(void)
}
#else // *nix
m_bIsNamed = false;
+ m_Event = new sem_t;
if (sem_init(m_Event, 0, 0))
{
LOGWARN("WARNING cEvent: Could not create unnamed semaphore, fallback to named.");
@@ -30,6 +31,7 @@ cEvent::cEvent(void)
// _X: I'm unconvinced about using sem_unlink() just after a successful sem_open(), it seems wrong - why destroy the object just after creating?
assert(!"This codepath is really weird, if it is ever used, please check that everything works.");
+ delete m_Event;
m_bIsNamed = true;
char c_Str[64];
@@ -70,6 +72,7 @@ cEvent::~cEvent()
else
{
sem_destroy(m_Event);
+ delete m_Event;
}
#endif
}
diff --git a/source/cEvent.h b/source/cEvent.h
index 11b9d7098..13a6a71f7 100644
--- a/source/cEvent.h
+++ b/source/cEvent.h
@@ -31,7 +31,6 @@ private:
HANDLE m_Event;
#else
sem_t * m_Event;
- bool m_bIsNamed;
#endif
} ;