From 8ecdb0fdc1b7b45a850b43630fed45e7a69a3c52 Mon Sep 17 00:00:00 2001 From: DrSlony Date: Thu, 14 Feb 2013 22:28:03 +0000 Subject: [PATCH] Fix for crash when zooming thumbs in/out in File Browser tab. Committed on behalf of samtygier, issue 1675 --- rtgui/thumbnail.cc | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/rtgui/thumbnail.cc b/rtgui/thumbnail.cc index 7fed249a5..fe3499b96 100644 --- a/rtgui/thumbnail.cc +++ b/rtgui/thumbnail.cc @@ -409,19 +409,10 @@ void Thumbnail::decreaseRef () } void Thumbnail::getThumbnailSize (int &w, int &h) { - // TODO: Check for Linux - #ifdef WIN32 - Glib::Mutex::Lock lock(mutex); - #endif - - w=0; - if (!initial_ && tpp) w = tpp->getImageWidth (getProcParams(), h, imgRatio); // this might return 0 if image was just building - if (w==0) { - if (imgRatio > 0.) - w = (int)(imgRatio * (float)h); - else - w = tw * h / th; - } + if (imgRatio > 0.) + w = (int)(imgRatio * (float)h); + else + w = tw * h / th; } void Thumbnail::getFinalSize (const rtengine::procparams::ProcParams& pparams, int& w, int& h) { @@ -653,7 +644,7 @@ void Thumbnail::_loadThumbnail(bool firstTrial) { tpp->init (); } - getThumbnailSize(tw,th); + if (!initial_ && tpp) tw = tpp->getImageWidth (getProcParams(), th, imgRatio); // this might return 0 if image was just building } void Thumbnail::loadThumbnail (bool firstTrial) {