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:
authorBastien Montagne <montagne29@wanadoo.fr>2016-08-26 13:54:49 +0300
committerBastien Montagne <montagne29@wanadoo.fr>2016-08-26 13:54:49 +0300
commita80977cd213d1a158f4292b9809c85a5b2a7a699 (patch)
tree7f2035a1d3042f9203164ac92c2e77e68e562202 /source/blender/blenloader/intern/readfile.c
parentf73c4b421dab01d6d257582cc76be42933c5c59f (diff)
Fix T49139: Memory leak in UV image editor related to Undo (and possibly Waveform and Vectorscope).
Assigning NULL to scopes' data pointer in 'non-UI readfile' context was terribly wrong for sure, if we'd really want to reset them here we should freed them first. But we can rather just ignore them here, those are purely runtime data managed by image editor, no need to touch them here.
Diffstat (limited to 'source/blender/blenloader/intern/readfile.c')
-rw-r--r--source/blender/blenloader/intern/readfile.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index ded60af4af2..7d65dbc2e17 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -6697,10 +6697,13 @@ void blo_lib_link_screen_restore(Main *newmain, bScreen *curscreen, Scene *cursc
* since it gets initialized later */
sima->iuser.scene = NULL;
- sima->scopes.waveform_1 = NULL;
- sima->scopes.waveform_2 = NULL;
- sima->scopes.waveform_3 = NULL;
- sima->scopes.vecscope = NULL;
+#if 0
+ /* Those are allocated and freed by space code, no need to handle them here. */
+ MEM_SAFE_FREE(sima->scopes.waveform_1);
+ MEM_SAFE_FREE(sima->scopes.waveform_2);
+ MEM_SAFE_FREE(sima->scopes.waveform_3);
+ MEM_SAFE_FREE(sima->scopes.vecscope);
+#endif
sima->scopes.ok = 0;
/* NOTE: pre-2.5, this was local data not lib data, but now we need this as lib data