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:
@@ -40,6 +40,13 @@ Main *BKE_main_new()
|
|||||||
|
|
||||||
void BKE_main_free(Main *mainvar)
|
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 */
|
/* also call when reading a file, erase all, etc */
|
||||||
ListBase *lbarray[INDEX_ID_MAX];
|
ListBase *lbarray[INDEX_ID_MAX];
|
||||||
int a;
|
int a;
|
||||||
|
Reference in New Issue
Block a user