Segfault closing second detail window before its done rendering, Issue 2395
This commit is contained in:
@@ -205,6 +205,9 @@ class ImProcCoordinator : public StagedImageProcessor {
|
|||||||
void getSpotWB (int x, int y, int rectSize, double& temp, double& green);
|
void getSpotWB (int x, int y, int rectSize, double& temp, double& green);
|
||||||
void getAutoCrop (double ratio, int &x, int &y, int &w, int &h);
|
void getAutoCrop (double ratio, int &x, int &y, int &w, int &h);
|
||||||
|
|
||||||
|
bool updateTryLock () {return updaterThreadStart.trylock();}
|
||||||
|
void updateUnLock () {updaterThreadStart.unlock();}
|
||||||
|
|
||||||
void setProgressListener (ProgressListener* pl) { plistener = pl; }
|
void setProgressListener (ProgressListener* pl) { plistener = pl; }
|
||||||
void setPreviewImageListener (PreviewImageListener* il) {imageListener = il; }
|
void setPreviewImageListener (PreviewImageListener* il) {imageListener = il; }
|
||||||
void setSizeListener (SizeListener* il) {sizeListeners.push_back (il); }
|
void setSizeListener (SizeListener* il) {sizeListeners.push_back (il); }
|
||||||
|
@@ -330,6 +330,10 @@ namespace rtengine {
|
|||||||
* @return the height of the preview image */
|
* @return the height of the preview image */
|
||||||
virtual int getPreviewHeight () =0;
|
virtual int getPreviewHeight () =0;
|
||||||
|
|
||||||
|
virtual bool updateTryLock() = 0;
|
||||||
|
|
||||||
|
virtual void updateUnLock() = 0;
|
||||||
|
|
||||||
/** Creates and returns a Crop instance that acts as a window on the image
|
/** Creates and returns a Crop instance that acts as a window on the image
|
||||||
* @param editDataProvider pointer to the EditDataProvider that communicates with the EditSubscriber
|
* @param editDataProvider pointer to the EditDataProvider that communicates with the EditSubscriber
|
||||||
* @return a pointer to the Crop object that handles the image data trough its own pipeline */
|
* @return a pointer to the Crop object that handles the image data trough its own pipeline */
|
||||||
|
@@ -67,7 +67,7 @@ CropWindow::CropWindow (ImageArea* parent, rtengine::StagedImageProcessor* ipc_,
|
|||||||
backColor(options.bgcolor), decorated(true), titleHeight(30),
|
backColor(options.bgcolor), decorated(true), titleHeight(30),
|
||||||
sideBorderWidth(3), lowerBorderWidth(3), upperBorderWidth(1), sepWidth(2),
|
sideBorderWidth(3), lowerBorderWidth(3), upperBorderWidth(1), sepWidth(2),
|
||||||
xpos(30), ypos(30), imgX(0), imgY(0), imgW(1), imgH(1), iarea(parent),
|
xpos(30), ypos(30), imgX(0), imgY(0), imgW(1), imgH(1), iarea(parent),
|
||||||
cropZoom(0), cropgl(NULL), pmlistener(NULL), observedCropWin(NULL), isFlawnOver(false) {
|
cropZoom(0), cropgl(NULL), pmlistener(NULL), observedCropWin(NULL), ipc(ipc_), isFlawnOver(false) {
|
||||||
|
|
||||||
Glib::RefPtr<Pango::Context> context = parent->get_pango_context () ;
|
Glib::RefPtr<Pango::Context> context = parent->get_pango_context () ;
|
||||||
Pango::FontDescription fontd = context->get_font_description ();
|
Pango::FontDescription fontd = context->get_font_description ();
|
||||||
@@ -1585,8 +1585,11 @@ void CropWindow::buttonPressed (LWButton* button, int actionCode, void* actionDa
|
|||||||
else if (button==bZoom100) // zoom 100
|
else if (button==bZoom100) // zoom 100
|
||||||
zoom11 ();
|
zoom11 ();
|
||||||
else if (button==bClose) {// close
|
else if (button==bClose) {// close
|
||||||
deleted = true;
|
if(ipc->updateTryLock()) {
|
||||||
iarea->cropWindowClosed (this);
|
deleted = true;
|
||||||
|
iarea->cropWindowClosed (this);
|
||||||
|
ipc->updateUnLock();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -84,6 +84,7 @@ class CropWindow : public LWButtonListener, public CropHandlerListener, public E
|
|||||||
std::list<CropWindowListener*> listeners;
|
std::list<CropWindowListener*> listeners;
|
||||||
|
|
||||||
CropWindow* observedCropWin;
|
CropWindow* observedCropWin;
|
||||||
|
rtengine::StagedImageProcessor* ipc;
|
||||||
|
|
||||||
bool onArea (CursorArea a, int x, int y);
|
bool onArea (CursorArea a, int x, int y);
|
||||||
void updateCursor (int x, int y);
|
void updateCursor (int x, int y);
|
||||||
|
Reference in New Issue
Block a user