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:
authorCampbell Barton <ideasman42@gmail.com>2008-03-16 17:28:00 +0300
committerCampbell Barton <ideasman42@gmail.com>2008-03-16 17:28:00 +0300
commit26daad49a3fcb8fc513ff8c6a0ab491fb775a586 (patch)
tree7ad2f5a60e077b531588655d2030d589b172c09d /source/blender/python/api2_2x
parentbead422c1f0bc2a8bd6ca4dd86f83dbfb1254c55 (diff)
[8559] Python script that uses FIleSelector and has an error in it segfaults Blender
Want completely fixed, check if the script was removed before running the callback.
Diffstat (limited to 'source/blender/python/api2_2x')
-rw-r--r--source/blender/python/api2_2x/Window.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/source/blender/python/api2_2x/Window.c b/source/blender/python/api2_2x/Window.c
index 5cfe796add8..9f1d79ffd3c 100644
--- a/source/blender/python/api2_2x/Window.c
+++ b/source/blender/python/api2_2x/Window.c
@@ -513,6 +513,14 @@ static void getSelectedFile( char *name )
script = sc->script;
}
}
+ /* If 'script' is null,
+ * The script must have had an error and closed,
+ * but the fileselector was left open, show an error and exit */
+ if (!script) {
+ error("Python script error: script quit, cannot run callback");
+ return;
+ }
+
pycallback = script->py_browsercallback;