diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2018-03-23 01:09:19 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2018-03-23 01:25:28 +0300 |
commit | 4cb4556fa5ba78fff69cf2f6cb1d156d1705a5c5 (patch) | |
tree | e0e441ae7d6bf01ef16395119904aa39ebe8a35a /source/blender/windowmanager/wm.h | |
parent | 150ad2238c913d3540119995131f055f5527ba55 (diff) |
Fix T48027: Memory leaks when exiting Blender from menu
You only had to close Blender through File -> Quit.
Leaks happened because WM_exit() was called from within operator, UI wasn't able
to free some of it's heap data then. This data was the handler added in
uiTemplateRunningJobs() and the IDProperty group added in uiItemFullO_ptr_ex().
There was obviously a general design issue which only became visible in this
specific case.
We now delay the WM_exit call by wrapping it into a handler that gets registered
as usual. I didn't see a better way to do this, all tricks done in
ui_apply_but_funcs_after() to prevent leaks didn't work here. In fact they may
be redundant now, but am not brave enough to try ;)
Diffstat (limited to 'source/blender/windowmanager/wm.h')
-rw-r--r-- | source/blender/windowmanager/wm.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/windowmanager/wm.h b/source/blender/windowmanager/wm.h index a417a719b8d..5ced36a104f 100644 --- a/source/blender/windowmanager/wm.h +++ b/source/blender/windowmanager/wm.h @@ -43,6 +43,9 @@ typedef struct wmPaintCursor { void (*draw)(bContext *C, int, int, void *customdata); } wmPaintCursor; + +void wm_exit_schedule_delayed(const bContext *C); + extern void wm_close_and_free(bContext *C, wmWindowManager *); extern void wm_close_and_free_all(bContext *C, ListBase *); |