From a75b4af3744039072c7a03ef4ed6fcb536763937 Mon Sep 17 00:00:00 2001 From: fredb Date: Tue, 21 Feb 2006 12:59:31 +0000 Subject: [PATCH] Melchior FRANZ: - don't unlock an already unlocked mutex (Someone wanted to be on the safe side with this, but the result is undefined and makes pthread_mutex_destroy fail. Reference: manpage for pthread_mutexattr_gettype/The Open Group[1]: "Attempting to unlock a mutex of this type which is not locked results in undefined behaviour.") - re-enabled all subsystem destructors again (this has been disabled because fgfs hung on exit, due to the mutex destroy failure from above.) Reference: http://www.opengroup.org/onlinepubs/007908799/xsh/pthread_mutexattr_gettype.html --- simgear/structure/subsystem_mgr.cxx | 3 +-- simgear/threads/SGQueue.hxx | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/simgear/structure/subsystem_mgr.cxx b/simgear/structure/subsystem_mgr.cxx index 9ae7d706..3be90962 100644 --- a/simgear/structure/subsystem_mgr.cxx +++ b/simgear/structure/subsystem_mgr.cxx @@ -224,8 +224,7 @@ SGSubsystemGroup::Member::Member (const Member &) SGSubsystemGroup::Member::~Member () { - // FIXME: causes a crash -// delete subsystem; + delete subsystem; } void diff --git a/simgear/threads/SGQueue.hxx b/simgear/threads/SGQueue.hxx index 532106bf..9f534ec9 100644 --- a/simgear/threads/SGQueue.hxx +++ b/simgear/threads/SGQueue.hxx @@ -183,7 +183,7 @@ public: /** * Destroy this queue. */ - ~SGBlockingQueue() { mutex.unlock(); } + ~SGBlockingQueue() {} /** * -- 2.39.5