Fixed crash when editing an image in thumb browser without saving; see issue #620

This commit is contained in:
Oliver Duis
2011-04-06 19:51:26 +02:00
parent 4aa4030d90
commit 5bab7f4ca5
2 changed files with 26 additions and 7 deletions

View File

@@ -309,14 +309,18 @@ void FileBrowser::close () {
Glib::Mutex::Lock lock(entryMutex);
#endif
selected.clear ();
notifySelectionListener ();
// The listener merges parameters with old values, so delete afterwards
for (int i=0; i<fd.size(); i++)
{
delete fd[i];
}
fd.clear ();
selected.clear ();
}
notifySelectionListener ();
lastClicked = NULL;
}

View File

@@ -140,7 +140,10 @@ bool Thumbnail::isSupported () {
}
const ProcParams& Thumbnail::getProcParams () {
//Glib::Mutex::Lock lock(mutex);
// TODO: Check for Linux
#ifdef WIN32
Glib::Mutex::Lock lock(mutex);
#endif
if (pparamsValid)
return pparams;
@@ -161,7 +164,10 @@ const ProcParams& Thumbnail::getProcParams () {
}
void Thumbnail::loadProcParams () {
//Glib::Mutex::Lock lock(mutex);
// TODO: Check for Linux
#ifdef WIN32
Glib::Mutex::Lock lock(mutex);
#endif
pparamsValid = false;
if (options.paramsLoadLocation==PLL_Input) {
@@ -183,7 +189,10 @@ void Thumbnail::loadProcParams () {
}
void Thumbnail::clearProcParams (int whoClearedIt) {
//Glib::Mutex::Lock lock(mutex);
// TODO: Check for Linux
#ifdef WIN32
Glib::Mutex::Lock lock(mutex);
#endif
cfs.recentlySaved = false;
pparamsValid = false;
@@ -211,7 +220,10 @@ bool Thumbnail::hasProcParams () {
}
void Thumbnail::setProcParams (const ProcParams& pp, int whoChangedIt, bool updateCacheNow) {
//Glib::Mutex::Lock lock(mutex);
// TODO: Check for Linux
#ifdef WIN32
Glib::Mutex::Lock lock(mutex);
#endif
if (pparams!=pp)
cfs.recentlySaved = false;
@@ -523,7 +535,10 @@ void Thumbnail::updateCache () {
}
Thumbnail::~Thumbnail () {
//Glib::Mutex::Lock lock(mutex);
// TODO: Check for Linux
#ifdef WIN32
Glib::Mutex::Lock lock(mutex);
#endif
delete [] lastImg;
delete tpp;