[Bf-blender-cvs] [c7f67c3c1dc] temp-gpencil-fill: GPencil: Move free image in fill operator

Antonio Vazquez noreply at git.blender.org
Thu Jan 28 20:07:41 CET 2021


Commit: c7f67c3c1dccb9229c219517f415fd1fb3879203
Author: Antonio Vazquez
Date:   Thu Jan 28 20:07:38 2021 +0100
Branches: temp-gpencil-fill
https://developer.blender.org/rBc7f67c3c1dccb9229c219517f415fd1fb3879203

GPencil: Move free image in fill operator

This is in preparation for multiframe fill

===================================================================

M	source/blender/editors/gpencil/gpencil_fill.c

===================================================================

diff --git a/source/blender/editors/gpencil/gpencil_fill.c b/source/blender/editors/gpencil/gpencil_fill.c
index 655800e8f86..ed812e1250d 100644
--- a/source/blender/editors/gpencil/gpencil_fill.c
+++ b/source/blender/editors/gpencil/gpencil_fill.c
@@ -1484,7 +1484,6 @@ static tGPDfill *gpencil_session_init_fill(bContext *C, wmOperator *UNUSED(op))
 /* end operator */
 static void gpencil_fill_exit(bContext *C, wmOperator *op)
 {
-  Main *bmain = CTX_data_main(C);
   Object *ob = CTX_data_active_object(C);
 
   /* clear undo stack */
@@ -1508,11 +1507,6 @@ static void gpencil_fill_exit(bContext *C, wmOperator *op)
       ED_region_draw_cb_exit(tgpf->region->type, tgpf->draw_handle_3d);
     }
 
-    /* Delete temp image. */
-    if (tgpf->ima) {
-      BKE_id_free(bmain, tgpf->ima);
-    }
-
     /* finally, free memory used by temp data */
     MEM_freeN(tgpf);
   }
@@ -1811,6 +1805,11 @@ static int gpencil_fill_modal(bContext *C, wmOperator *op, const wmEvent *event)
                 MEM_SAFE_FREE(tgpf->sbuffer);
                 MEM_SAFE_FREE(tgpf->depth_arr);
               }
+
+              /* Delete temp image. */
+              if (tgpf->ima) {
+                BKE_id_free(tgpf->bmain, tgpf->ima);
+              }
             }
 
             /* Free temp stroke. */



More information about the Bf-blender-cvs mailing list