Bugfix: RT could crash while displaying Color Pickers (no issue)

This commit is contained in:
Hombre 2016-12-11 17:17:36 +01:00
parent 976fc087bd
commit 1f080e0438

View File

@ -2083,11 +2083,16 @@ void CropWindow::updateHoveredPicker (rtengine::Coord *imgPos)
} }
LockableColorPicker::Validity validity = checkValidity (hoveredPicker, cropPos); LockableColorPicker::Validity validity = checkValidity (hoveredPicker, cropPos);
hoveredPicker->setValidity (validity); hoveredPicker->setValidity (validity);
{
MyMutex::MyLock lock(cropHandler.cimg);
if (validity == LockableColorPicker::Validity::INSIDE) { if (validity == LockableColorPicker::Validity::INSIDE) {
cropHandler.colorPick(cropPos, r, g, b, rpreview, gpreview, bpreview, hoveredPicker->getSize()); cropHandler.colorPick(cropPos, r, g, b, rpreview, gpreview, bpreview, hoveredPicker->getSize());
hoveredPicker->setRGB (r, g, b, rpreview, gpreview, bpreview); hoveredPicker->setRGB (r, g, b, rpreview, gpreview, bpreview);
} }
} }
}
void CropWindow::changeZoom (int zoom, bool notify, int centerx, int centery) void CropWindow::changeZoom (int zoom, bool notify, int centerx, int centery)
{ {
@ -2450,6 +2455,7 @@ void CropWindow::drawObservedFrame (Cairo::RefPtr<Cairo::Context> cr, int rw, in
void CropWindow::cropImageUpdated () void CropWindow::cropImageUpdated ()
{ {
MyMutex::MyLock lock(cropHandler.cimg);
for (auto colorPicker : colorPickers) { for (auto colorPicker : colorPickers) {
Coord imgPos, cropPos; Coord imgPos, cropPos;