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
e35afd8a1d
commit
3e5ce23c99
|
@ -40,6 +40,13 @@ Main *BKE_main_new()
|
|||
|
||||
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…
Reference in New Issue