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>2010-11-18 19:33:13 +0300
committerCampbell Barton <ideasman42@gmail.com>2010-11-18 19:33:13 +0300
commit23fbce5a5fc18f310abfc391654108c6bd7d12bc (patch)
treee82d8b7a4696896eb3297d1b7c78b4c47bf67788 /source/blender/windowmanager
parent3ae670fc02f9e4eadf3c92f8c8c30df81e4aaaf2 (diff)
bugfix [#22615] Opening a blend file in python (bpy.ops.wm.open_mainfile() (r29489)
[#22557] bpy.ops.wm.read_homefile() causes segfault (r29372)
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_event_system.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c
index c30152c05eb..943467d80ab 100644
--- a/source/blender/windowmanager/intern/wm_event_system.c
+++ b/source/blender/windowmanager/intern/wm_event_system.c
@@ -438,7 +438,7 @@ static void wm_operator_reports(bContext *C, wmOperator *op, int retval, int pop
*/
static int wm_operator_register_check(wmWindowManager *wm, wmOperatorType *ot)
{
- return (wm->op_undo_depth == 0) && (ot->flag & OPTYPE_REGISTER);
+ return wm && (wm->op_undo_depth == 0) && (ot->flag & OPTYPE_REGISTER);
}
static void wm_operator_finished(bContext *C, wmOperator *op, int repeat)
@@ -831,7 +831,6 @@ int WM_operator_name_call(bContext *C, const char *opstring, int context, Pointe
*/
int WM_operator_call_py(bContext *C, wmOperatorType *ot, int context, PointerRNA *properties, ReportList *reports)
{
- wmWindowManager *wm= CTX_wm_manager(C);
int retval= OPERATOR_CANCELLED;
#if 0
@@ -855,7 +854,7 @@ int WM_operator_call_py(bContext *C, wmOperatorType *ot, int context, PointerRNA
/* keep the reports around if needed later */
if ( (retval & OPERATOR_RUNNING_MODAL) ||
- ((retval & OPERATOR_FINISHED) && wm_operator_register_check(wm, ot))
+ ((retval & OPERATOR_FINISHED) && wm_operator_register_check(CTX_wm_manager(C), ot))
) {
reports->flag |= RPT_FREE; /* let blender manage freeing */
}
@@ -1722,7 +1721,11 @@ void wm_event_do_handlers(bContext *C)
}
action |= wm_handlers_do(C, event, &ar->handlers);
-
+
+ /* fileread case (python), [#29489] */
+ if(CTX_wm_window(C)==NULL)
+ return;
+
doit |= (BLI_in_rcti(&ar->winrct, event->x, event->y));
if(action & WM_HANDLER_BREAK)