diff options
author | Campbell Barton <ideasman42@gmail.com> | 2014-06-18 09:48:38 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2014-06-18 09:49:40 +0400 |
commit | b16bf6c3d4204ba5399f9854f7888630e984fe59 (patch) | |
tree | 0769f03bf2e4f674535680b49481023988412c7e /source/blender/editors/util | |
parent | 24090ead012e3774fabc25a88909e51931e1a5bc (diff) |
Resolve memory leask with reports on initialization
Diffstat (limited to 'source/blender/editors/util')
-rw-r--r-- | source/blender/editors/util/ed_util.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/source/blender/editors/util/ed_util.c b/source/blender/editors/util/ed_util.c index 2580836cad9..178af8c836a 100644 --- a/source/blender/editors/util/ed_util.c +++ b/source/blender/editors/util/ed_util.c @@ -41,7 +41,9 @@ #include "DNA_scene_types.h" #include "DNA_packedFile_types.h" -#include "BLI_blenlib.h" +#include "BLI_utildefines.h" +#include "BLI_string.h" +#include "BLI_path_util.h" #include "BIF_gl.h" #include "BIF_glutil.h" @@ -82,6 +84,12 @@ void ED_editors_init(bContext *C) Object *ob, *obact = (sce && sce->basact) ? sce->basact->object : NULL; ID *data; + /* This is called during initialization, so we don't want to store any reports */ + ReportList *reports = CTX_wm_reports(C); + int reports_flag_prev = reports->flag &= ~RPT_STORE; + + SWAP(int, reports->flag, reports_flag_prev); + /* toggle on modes for objects that were saved with these enabled. for * e.g. linked objects we have to ensure that they are actually the * active object in this scene. */ @@ -101,6 +109,8 @@ void ED_editors_init(bContext *C) if (sce) { ED_space_image_paint_update(wm, sce->toolsettings); } + + SWAP(int, reports->flag, reports_flag_prev); } /* frees all editmode stuff */ |