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.
This commit is contained in:
Bastien Montagne 2016-08-26 12:54:49 +02:00
parent f73c4b421d
commit a80977cd21
Notes: blender-bot 2023-02-14 07:40:51 +01:00
Referenced by issue #49139, Memory leak in UV image editor related to Undo (and possibly Waveform and Vectorscope)
1 changed files with 7 additions and 4 deletions

View File

@ -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