summaryrefslogtreecommitdiffstats
path: root/src/OSSupport
diff options
context:
space:
mode:
authorarchshift <admin@archshift.com>2014-06-19 10:49:56 +0200
committerarchshift <admin@archshift.com>2014-06-19 10:49:56 +0200
commite8143de01bff31f9e153949d7ab5b0df82629541 (patch)
treed6a37e6433f973765c8ca63e408dbbd420b08d70 /src/OSSupport
parentMerge pull request #1096 from mc-server/redstonerefactor (diff)
downloadcuberite-e8143de01bff31f9e153949d7ab5b0df82629541.tar
cuberite-e8143de01bff31f9e153949d7ab5b0df82629541.tar.gz
cuberite-e8143de01bff31f9e153949d7ab5b0df82629541.tar.bz2
cuberite-e8143de01bff31f9e153949d7ab5b0df82629541.tar.lz
cuberite-e8143de01bff31f9e153949d7ab5b0df82629541.tar.xz
cuberite-e8143de01bff31f9e153949d7ab5b0df82629541.tar.zst
cuberite-e8143de01bff31f9e153949d7ab5b0df82629541.zip
Diffstat (limited to '')
-rw-r--r--src/OSSupport/Event.cpp1
-rw-r--r--src/OSSupport/SocketThreads.cpp1
-rw-r--r--src/OSSupport/Thread.cpp2
3 files changed, 4 insertions, 0 deletions
diff --git a/src/OSSupport/Event.cpp b/src/OSSupport/Event.cpp
index 649a0a3cf..6b8fccde2 100644
--- a/src/OSSupport/Event.cpp
+++ b/src/OSSupport/Event.cpp
@@ -71,6 +71,7 @@ cEvent::~cEvent()
{
sem_destroy(m_Event);
delete m_Event;
+ m_Event = NULL;
}
#endif
}
diff --git a/src/OSSupport/SocketThreads.cpp b/src/OSSupport/SocketThreads.cpp
index 0ab5b6298..ca8b8438d 100644
--- a/src/OSSupport/SocketThreads.cpp
+++ b/src/OSSupport/SocketThreads.cpp
@@ -61,6 +61,7 @@ bool cSocketThreads::AddClient(const cSocket & a_Socket, cCallback * a_Client)
// There was an error launching the thread (but it was already logged along with the reason)
LOGERROR("A new cSocketThread failed to start");
delete Thread;
+ Thread = NULL;
return false;
}
Thread->AddClient(a_Socket, a_Client);
diff --git a/src/OSSupport/Thread.cpp b/src/OSSupport/Thread.cpp
index 7a10ef8d2..535784613 100644
--- a/src/OSSupport/Thread.cpp
+++ b/src/OSSupport/Thread.cpp
@@ -66,11 +66,13 @@ cThread::cThread( ThreadFunc a_ThreadFunction, void* a_Param, const char* a_Thre
cThread::~cThread()
{
delete m_Event;
+ m_Event = NULL;
if( m_StopEvent )
{
m_StopEvent->Wait();
delete m_StopEvent;
+ m_StopEvent = NULL;
}
}