Revision: 21272
http://opalvoip.svn.sourceforge.net/opalvoip/?rev=21272&view=rev
Author: hfriederich
Date: 2008-10-08 19:49:41 +0000 (Wed, 08 Oct 2008)
Log Message:
-----------
Avoid abnormal _exit(1) when destroying the PProcess instance
Modified Paths:
--------------
ptlib/trunk/src/ptlib/unix/tlibthrd.cxx
Modified: ptlib/trunk/src/ptlib/unix/tlibthrd.cxx
===================================================================
--- ptlib/trunk/src/ptlib/unix/tlibthrd.cxx 2008-10-08 16:53:38 UTC (rev 21271)
+++ ptlib/trunk/src/ptlib/unix/tlibthrd.cxx 2008-10-08 19:49:41 UTC (rev 21272)
@@ -330,10 +330,14 @@
pthread_mutex_unlock(&PX_suspendMutex);
pthread_mutex_destroy(&PX_suspendMutex);
- if (this != &PProcess::Current())
- PTRACE(1, "PWLib\tDestroyed thread " << this << ' ' << threadName << "(id = " << ::hex << PX_threadId << ::dec << ")");
- else
- PProcessInstance = NULL;
+ // PProcess is a subclass of PThread, if the PProcess instance is deleted,
+ // this destructor runs but PProcessInstance is already set to NULL
+ if (PProcessInstance != NULL) {
+ if (this != PProcessInstance)
+ PTRACE(1, "PWLib\tDestroyed thread " << this << ' ' << threadName << "(id = " << ::hex << PX_threadId << ::dec << ")");
+ else
+ PProcessInstance = NULL;
+ }
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|