mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix (unreported) potential leak in Main freeing function.
Could happen in case a 'split-by-libraries' Main is passed to `BKE_main_free`.
This commit is contained in:
parent
a7633d6b57
commit
6eb89d115f
1 changed files with 7 additions and 0 deletions
|
|
@ -52,6 +52,13 @@ Main *BKE_main_new(void)
|
|||
|
||||
void BKE_main_free(Main *mainvar)
|
||||
{
|
||||
/* In case this is called on a 'split-by-libraries' list of mains.
|
||||
*
|
||||
* Should not happen in typical usages, but can occur e.g. if a file reading is aborted. */
|
||||
if (mainvar->next) {
|
||||
BKE_main_free(mainvar->next);
|
||||
}
|
||||
|
||||
/* also call when reading a file, erase all, etc */
|
||||
ListBase *lbarray[INDEX_ID_MAX];
|
||||
int a;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue