Fix T56491: Undo crash while preview jobs run
authorCampbell Barton <ideasman42@gmail.com>
Fri, 24 Aug 2018 02:36:19 +0000 (12:36 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 24 Aug 2018 02:38:11 +0000 (12:38 +1000)
While the crash is in 2.8, it's possible undo operates on data
which isn't only owned by the current scene (any object for eg).

Thanks to @mont29 for suggesting the fix.

source/blender/editors/undo/ed_undo.c

index a13fa4af4e2df54ff1cc933e5a6c26d1fcf982eb..621c5d73d5af9be7a9232e4c56e83250de01760b 100644 (file)
@@ -111,9 +111,7 @@ static int ed_undo_step(bContext *C, int step, const char *undoname)
 
        /* undo during jobs are running can easily lead to freeing data using by jobs,
         * or they can just lead to freezing job in some other cases */
-       if (WM_jobs_test(wm, scene, WM_JOB_TYPE_ANY)) {
-               return OPERATOR_CANCELLED;
-       }
+       WM_jobs_kill_all(wm);
 
        /* TODO(campbell): undo_system: use undo system */
        /* grease pencil can be can be used in plenty of spaces, so check it first */