summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEike Rathke <erack@redhat.com>2012-07-16 17:49:14 +0200
committerMatúš Kukan <matus.kukan@gmail.com>2012-07-17 16:40:29 +0200
commit581860f47173a3ebc8f834d229e8d2878aaf12ba (patch)
treef088504161e73980ed1c52530c44849b050c8411
parenttubes: do not use mpManager after unref (diff)
downloadcore-581860f47173a3ebc8f834d229e8d2878aaf12ba.tar.gz
core-581860f47173a3ebc8f834d229e8d2878aaf12ba.zip
tubes: guard unref() against "accidental" calls
Change-Id: I73b0f8faaa9b6d0707153f3150ca531a33cb0dd3
-rw-r--r--tubes/source/manager.cxx2
1 files changed, 1 insertions, 1 deletions
diff --git a/tubes/source/manager.cxx b/tubes/source/manager.cxx
index b026d85a4da1..896fcc8c0cf3 100644
--- a/tubes/source/manager.cxx
+++ b/tubes/source/manager.cxx
@@ -372,7 +372,7 @@ void
TeleManager::unref()
{
MutexGuard aGuard( GetAnotherMutex());
- if (--nAnotherRefCount == 0) {
+ if (nAnotherRefCount && --nAnotherRefCount == 0) {
delete pSingleton;
pSingleton = NULL;
}