Skip to content

Commit

Permalink
libdeng2: Improved Lockable destructor
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Feb 27, 2013
1 parent a0ff040 commit 4bea096
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions doomsday/libdeng2/src/data/lockable.cpp
Expand Up @@ -38,14 +38,10 @@ Lockable::Lockable() : d(new Instance)

Lockable::~Lockable()
{
d->countMutex.lock();
while(d->lockCount > 0)
while(isLocked())
{
d->mutex.unlock();
d->lockCount--;
unlock();
}
d->countMutex.unlock();

delete d;
}

Expand Down

0 comments on commit 4bea096

Please sign in to comment.