diff --git a/rtgui/editorpanel.cc b/rtgui/editorpanel.cc index 3b8f82e39..6edb47316 100644 --- a/rtgui/editorpanel.cc +++ b/rtgui/editorpanel.cc @@ -402,14 +402,13 @@ void EditorPanel::close () { delete previewHandler; previewHandler= NULL; - rtengine::StagedImageProcessor::destroy (ipc); - ipc = NULL; - if(iarea) { iarea->imageArea->setPreviewHandler (NULL); iarea->imageArea->setImProcCoordinator (NULL); } + rtengine::StagedImageProcessor::destroy (ipc); + ipc = NULL; navigator->previewWindow->setPreviewHandler (NULL); // navigator->previewWindow->setImageArea (NULL); diff --git a/rtgui/imagearea.cc b/rtgui/imagearea.cc index 175ac32b1..99f9cf6b9 100644 --- a/rtgui/imagearea.cc +++ b/rtgui/imagearea.cc @@ -76,8 +76,22 @@ void ImageArea::on_resized (Gtk::Allocation& req) { } void ImageArea::setImProcCoordinator (rtengine::StagedImageProcessor* ipc_) { + if( !ipc_ ){ + focusGrabber = NULL; + std::list::iterator i = cropWins.begin(); + if( i!=cropWins.end() ){ + (*i)->getPosition (lastClosedX, lastClosedY); + (*i)->getSize (lastClosedW, lastClosedH); + } + for( ;i!=cropWins.end();i++ ){ + delete *i; + } + cropWins.clear(); + mainCropWindow->setObservedCropWin (NULL); + } ipc = ipc_; + } void ImageArea::setPreviewHandler (PreviewHandler* ph) {