[Digikam-devel] [Bug 138715] Crash when quickly switching to previous/next image [backtrace]
Gilles Caulier
caulier.gilles at kdemail.net
Fri Dec 15 06:40:15 GMT 2006
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
http://bugs.kde.org/show_bug.cgi?id=138715
caulier.gilles kdemail net changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |FIXED
------- Additional Comments From caulier.gilles kdemail net 2006-12-15 07:40 -------
SVN commit 613773 by cgilles:
digikam from trunk : Patch from Marcel to fix a race condition in threaded image I/O witch can crash digiKam in image editor.
BUG: 138715
M +13 -4 loadsavetask.cpp
--- trunk/extragear/graphics/digikam/libs/threadimageio/loadsavetask.cpp #613772:613773
@ -171,6 +171,8 @
m_usedProcess->removeListener(this);
// wake up the process which is waiting until all listeners have removed themselves
lock.wakeAll();
+ // set to 0, as checked in setStatus
+ m_usedProcess = 0;
//DDebug() << "SharedLoadingTask " << this << ": waited" << endl;
return;
}
@ -279,6 +281,8 @
// wait until all listeners have removed themselves
while (m_listeners.count() != 0)
lock.timedWait();
+ // set to 0, as checked in setStatus
+ m_usedProcess = 0;
}
};
@ -311,10 +315,15 @
{
LoadingCache *cache = LoadingCache::cache();
LoadingCache::CacheLock lock(cache);
- // remove this from list of listeners - check in continueQuery() of active thread
- m_usedProcess->removeListener(this);
- // wake all listeners - particularly this - from waiting on cache condvar
- lock.wakeAll();
+
+ // check for m_usedProcess, to avoid race condition that it has finished before
+ if (m_usedProcess)
+ {
+ // remove this from list of listeners - check in continueQuery() of active thread
+ m_usedProcess->removeListener(this);
+ // wake all listeners - particularly this - from waiting on cache condvar
+ lock.wakeAll();
+ }
}
}
More information about the Digikam-devel
mailing list