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
path: root/source
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2022-09-09 14:16:13 +0300
committerJacques Lucke <jacques@blender.org>2022-09-09 14:16:28 +0300
commitf15fecf0f701758b7cc4d9bf2d50153aed2cc8c8 (patch)
tree7734b098580a7a44ee478ef48c27151bf339989e /source
parentac66a819c14265ee3e0f48e4cb54b6c10b7fb064 (diff)
Readfile: avoid confusion when debugging a memory leak
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenloader/intern/readfile.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/readfile.c b/source/blender/blenloader/intern/readfile.c
index 506595fd6fe..bf2017b80f4 100644
--- a/source/blender/blenloader/intern/readfile.c
+++ b/source/blender/blenloader/intern/readfile.c
@@ -3065,7 +3065,11 @@ static BHead *read_data_into_datamap(FileData *fd, BHead *bhead, const char *all
* With the code below we get the struct-name to help tracking down the leak.
* This is kept disabled as the #malloc for the text always leaks memory. */
#if 0
- {
+ if (bhead->SDNAnr == 0) {
+ /* The data type here is unclear because #writedata sets SDNAnr to 0. */
+ allocname = "likely raw data";
+ }
+ else {
SDNA_Struct *sp = fd->filesdna->structs[bhead->SDNAnr];
allocname = fd->filesdna->types[sp->type];
size_t allocname_size = strlen(allocname) + 1;