Bugfixing crash when reprocessing the preview
This commit is contained in:
@@ -525,16 +525,20 @@ void ImProcCoordinator::updatePreviewImage(int todo, bool panningRelatedChange)
|
|||||||
|
|
||||||
progress ("Spot Removal...", 100 * readyphase / numofphases);
|
progress ("Spot Removal...", 100 * readyphase / numofphases);
|
||||||
|
|
||||||
if ((todo & M_SPOT) && params->spot.enabled && !params->spot.entries.empty ()) {
|
if (params->spot.enabled && !params->spot.entries.empty ()) {
|
||||||
// First update the image with spot healing
|
if ((todo & M_SPOT)) {
|
||||||
ipf.removeSpots (oprevi, params->spot.entries, previewProps);
|
// First update the image with spot healing
|
||||||
|
ipf.removeSpots (oprevi, params->spot.entries, previewProps);
|
||||||
|
|
||||||
// Then create fork the image to cache the data
|
// Then fork the image to cache the data
|
||||||
if (spot_prev == nullptr) {
|
if (spot_prev == nullptr) {
|
||||||
spot_prev = new Imagefloat (pW, pH);
|
spot_prev = new Imagefloat (pW, pH);
|
||||||
|
}
|
||||||
|
oprevi->copyData (spot_prev);
|
||||||
|
}
|
||||||
|
if (spot_prev) {
|
||||||
|
oprevi = spot_prev;
|
||||||
}
|
}
|
||||||
|
|
||||||
oprevi->copyData (spot_prev);
|
|
||||||
} else {
|
} else {
|
||||||
if (spot_prev) {
|
if (spot_prev) {
|
||||||
delete spot_prev;
|
delete spot_prev;
|
||||||
@@ -1125,7 +1129,7 @@ void ImProcCoordinator::setScale(int prevscale)
|
|||||||
pH = nH;
|
pH = nH;
|
||||||
|
|
||||||
orig_prev = new Imagefloat(pW, pH);
|
orig_prev = new Imagefloat(pW, pH);
|
||||||
spot_prev = oprevi = orig_prev;
|
oprevi = orig_prev;
|
||||||
oprevl = new LabImage(pW, pH);
|
oprevl = new LabImage(pW, pH);
|
||||||
nprevl = new LabImage(pW, pH);
|
nprevl = new LabImage(pW, pH);
|
||||||
//ncie is only used in ImProcCoordinator::updatePreviewImage, it will be allocated on first use and deleted if not used anymore
|
//ncie is only used in ImProcCoordinator::updatePreviewImage, it will be allocated on first use and deleted if not used anymore
|
||||||
|
Reference in New Issue
Block a user