1
0
Fork 0

Codefix: Delete PersistentStorage when a town is deleted. (#12903)

pull/12906/head
Peter Nelson 2024-08-19 08:18:01 +01:00 committed by GitHub
parent e4c04e86c0
commit 0f0f3d74ca
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 3 additions and 0 deletions

View File

@ -148,6 +148,9 @@ Town::~Town()
} }
/* Clear the persistent storage list. */ /* Clear the persistent storage list. */
for (auto &psa : this->psa_list) {
delete psa;
}
this->psa_list.clear(); this->psa_list.clear();
DeleteSubsidyWith(SourceType::Town, this->index); DeleteSubsidyWith(SourceType::Town, this->index);