Solving issue 2324: "Crash when creating detail window" / Credits: Ingo, Hombre
This commit is contained in:
@@ -47,11 +47,12 @@ Crop::Crop (ImProcCoordinator* parent, EditDataProvider *editDataProvider)
|
||||
Crop::~Crop () {
|
||||
|
||||
MyMutex::MyLock cropLock(cropMutex);
|
||||
MyMutex::MyLock processingLock(parent->mProcessing);
|
||||
|
||||
std::vector<Crop*>::iterator i = std::find (parent->crops.begin(), parent->crops.end(), this);
|
||||
if (i!=parent->crops.end ())
|
||||
parent->crops.erase (i);
|
||||
|
||||
MyMutex::MyLock processingLock(parent->mProcessing);
|
||||
freeAll ();
|
||||
}
|
||||
|
||||
|
@@ -45,7 +45,8 @@ CropHandler::~CropHandler () {
|
||||
|
||||
setEnabled (false);
|
||||
if (crop) {
|
||||
crop->destroy ();
|
||||
//crop->destroy ();
|
||||
delete crop; // will do the same than destroy, plus delete the object
|
||||
crop = NULL;
|
||||
}
|
||||
cimg.lock ();
|
||||
|
@@ -459,8 +459,12 @@ void CropWindow::buttonRelease (int button, int num, int bstate, int x, int y) {
|
||||
|
||||
if (decorated)
|
||||
buttonSet.releaseNotify (x, y);
|
||||
if (deleted)
|
||||
|
||||
if (deleted) {
|
||||
iarea->flawnOverWindow = NULL;
|
||||
delete this;
|
||||
return;
|
||||
}
|
||||
|
||||
state = SNormal;
|
||||
iarea->grabFocus (NULL);
|
||||
|
@@ -382,8 +382,9 @@ void ImageArea::addCropWindow () {
|
||||
cw->setPosition (col*get_width()/K + hBorder/2 + layer*30, row*get_height()/K + vBorder/2 + layer*30);
|
||||
}
|
||||
else {
|
||||
cw->setPosition (lastClosedX, lastClosedY);
|
||||
cw->setSize(lastClosedW, lastClosedH);
|
||||
cw->setPosition (lastClosedX, lastClosedY);
|
||||
lastClosedX = -1;
|
||||
}
|
||||
int x0,y0,w,h,wc,hc;
|
||||
mainCropWindow->getCropRectangle(x0,y0,w,h );
|
||||
@@ -414,7 +415,6 @@ void ImageArea::cropWindowClosed (CropWindow* cw) {
|
||||
std::list<CropWindow*>::iterator i = std::find (cropWins.begin(), cropWins.end(), cw);
|
||||
if (i!=cropWins.end())
|
||||
cropWins.erase (i);
|
||||
delete cw;
|
||||
if (!cropWins.empty())
|
||||
mainCropWindow->setObservedCropWin (cropWins.front());
|
||||
else
|
||||
|
@@ -55,7 +55,6 @@ class ImageArea : public Gtk::DrawingArea, public CropWindowListener, public Edi
|
||||
|
||||
bool dirty;
|
||||
CropWindow* focusGrabber;
|
||||
CropWindow* flawnOverWindow;
|
||||
CropGUIListener* cropgl;
|
||||
PointerMotionListener* pmlistener;
|
||||
PointerMotionListener* pmhlistener;
|
||||
@@ -65,6 +64,7 @@ class ImageArea : public Gtk::DrawingArea, public CropWindowListener, public Edi
|
||||
|
||||
public:
|
||||
CropWindow* mainCropWindow;
|
||||
CropWindow* flawnOverWindow;
|
||||
ZoomPanel* zoomPanel;
|
||||
IndicateClippedPanel* indClippedPanel;
|
||||
PreviewModePanel* previewModePanel;
|
||||
|
Reference in New Issue
Block a user