1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-20 21:43:06 +01:00

Part of #11159 (purge malloc() & free()) (#11893)

* Used smart pointers

* Changed functions to take vector as input
This commit is contained in:
rdbaris
2020-07-16 17:35:30 -04:00
committed by GitHub
parent f49149222e
commit a2493af9ce
5 changed files with 11 additions and 16 deletions

View File

@@ -321,7 +321,7 @@ void unload_unselected_objects()
const ObjectRepositoryItem* items = object_repository_get_items();
size_t numObjectsToUnload = 0;
rct_object_entry* objectsToUnload = static_cast<rct_object_entry*>(malloc(numItems * sizeof(rct_object_entry)));
std::vector<rct_object_entry> objectsToUnload;
for (int32_t i = 0; i < numItems; i++)
{
@@ -335,7 +335,6 @@ void unload_unselected_objects()
}
object_manager_unload_objects(objectsToUnload, numObjectsToUnload);
free(objectsToUnload);
}
/**