- attempt to fix double free bug reported by tomreyn

This commit is contained in:
Mark Vejvoda
2013-03-08 05:24:37 +00:00
parent 198fa1d05d
commit 704935c534
3 changed files with 12 additions and 6 deletions

View File

@@ -162,7 +162,7 @@ public:
#endif
}
}
void ReleaseLock(bool keepMutex=false) {
void ReleaseLock(bool keepMutex=false,bool deleteMutexOnRelease=false) {
if(this->mutex != NULL) {
#ifdef DEBUG_MUTEXES
if(ownerId != "") {
@@ -182,6 +182,11 @@ public:
}
#endif
if(deleteMutexOnRelease == true) {
delete this->mutex;
this->mutex = NULL;
}
if(keepMutex == false) {
this->mutex = NULL;
}