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>2013-01-22 06:21:21 +0400
committerCampbell Barton <ideasman42@gmail.com>2013-01-22 06:21:21 +0400
commit2cd25f4cf528fe7911b45da609e34d46757ff57e (patch)
tree1ce10722b803090e9d38507add23c3de0cb09c07 /source/blender/windowmanager
parent044e3398b959ae80096bf4f436fd5cca9e3a6203 (diff)
fix [#33836] issuing bpy.ops.render.render() in console crashes the program
don't check the event queue from threads, assert if this happens in future.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/intern/wm_window.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index 52024897f70..44c5693c3e3 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -75,6 +75,11 @@
#include "UI_interface.h"
+/* for assert */
+#ifndef NDEBUG
+# include "BLI_threads.h"
+#endif
+
/* the global to talk to ghost */
static GHOST_SystemHandle g_system = NULL;
@@ -1036,8 +1041,12 @@ static int wm_window_timer(const bContext *C)
void wm_window_process_events(const bContext *C)
{
- int hasevent = GHOST_ProcessEvents(g_system, 0); /* 0 is no wait */
-
+ int hasevent;
+
+ BLI_assert(BLI_thread_is_main());
+
+ hasevent = GHOST_ProcessEvents(g_system, 0); /* 0 is no wait */
+
if (hasevent)
GHOST_DispatchEvents(g_system);
@@ -1059,7 +1068,9 @@ void wm_window_testbreak(void)
{
static double ltime = 0;
double curtime = PIL_check_seconds_timer();
-
+
+ BLI_assert(BLI_thread_is_main());
+
/* only check for breaks every 50 milliseconds
* if we get called more often.
*/