Fix leak of scene used for customization during export

(cherry picked from commit d103b5570f)
This commit is contained in:
Pedro J. Estébanez 2024-02-23 19:30:55 +01:00 committed by Rémi Verschelde
parent b1b5cb9d6f
commit 583b48c43f
No known key found for this signature in database
GPG Key ID: C3336907360768E1
1 changed files with 2 additions and 0 deletions

View File

@ -784,6 +784,8 @@ String EditorExportPlatform::_export_customize(const String &p_path, LocalVector
Error err = ResourceSaver::save(s, save_path);
ERR_FAIL_COND_V_MSG(err != OK, p_path, "Unable to save export scene file to: " + save_path);
}
node->queue_free();
} else {
Ref<Resource> res = ResourceLoader::load(p_path, "", ResourceFormatLoader::CACHE_MODE_IGNORE);
ERR_FAIL_COND_V(res.is_null(), p_path);