Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTon Roosendaal <ton@blender.org>2011-03-03 18:18:35 +0300
committerTon Roosendaal <ton@blender.org>2011-03-03 18:18:35 +0300
commitb18870e6da68730c628ccc147898abe5c7b8e456 (patch)
treed5cfe8cf6feef9985d1cefbe437ce2578f5941db /source/blender/editors/space_image
parent3074529c7fa5ed250cfd168321dbc7b2ff59a345 (diff)
Bugfix #26307
Blender crashed on repeatedly pressing "reload image" or "unpack" and other image options, with a material/texture preview running. Solved with a signal to stop preview render before doing the action.
Diffstat (limited to 'source/blender/editors/space_image')
-rw-r--r--source/blender/editors/space_image/image_ops.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/source/blender/editors/space_image/image_ops.c b/source/blender/editors/space_image/image_ops.c
index 978c0739abb..fd2c14dd434 100644
--- a/source/blender/editors/space_image/image_ops.c
+++ b/source/blender/editors/space_image/image_ops.c
@@ -67,6 +67,7 @@
#include "RNA_enum_types.h"
#include "ED_image.h"
+#include "ED_render.h"
#include "ED_screen.h"
#include "ED_space_api.h"
#include "ED_uvedit.h"
@@ -747,6 +748,9 @@ static int open_exec(bContext *C, wmOperator *op)
iuser->fie_ima= 2;
}
+ /* XXX unpackImage frees image buffers */
+ ED_preview_kill_jobs(C);
+
BKE_image_signal(ima, iuser, IMA_SIGNAL_RELOAD);
WM_event_add_notifier(C, NC_IMAGE|NA_EDITED, ima);
@@ -820,6 +824,9 @@ static int replace_exec(bContext *C, wmOperator *op)
RNA_string_get(op->ptr, "filepath", str);
BLI_strncpy(sima->image->name, str, sizeof(sima->image->name)); /* we cant do much if the str is longer then 240 :/ */
+ /* XXX unpackImage frees image buffers */
+ ED_preview_kill_jobs(C);
+
BKE_image_signal(sima->image, &sima->iuser, IMA_SIGNAL_RELOAD);
WM_event_add_notifier(C, NC_IMAGE|NA_EDITED, sima->image);
@@ -1236,6 +1243,9 @@ static int reload_exec(bContext *C, wmOperator *UNUSED(op))
if(!ima)
return OPERATOR_CANCELLED;
+ /* XXX unpackImage frees image buffers */
+ ED_preview_kill_jobs(C);
+
// XXX other users?
BKE_image_signal(ima, (sima)? &sima->iuser: NULL, IMA_SIGNAL_RELOAD);
@@ -1542,7 +1552,10 @@ static int image_unpack_exec(bContext *C, wmOperator *op)
if(G.fileflags & G_AUTOPACK)
BKE_report(op->reports, RPT_WARNING, "AutoPack is enabled, so image will be packed again on file save.");
-
+
+ /* XXX unpackImage frees image buffers */
+ ED_preview_kill_jobs(C);
+
unpackImage(op->reports, ima, method);
WM_event_add_notifier(C, NC_IMAGE|NA_EDITED, ima);