mirror of https://github.com/OpenRCT2/OpenRCT2.git
Fix memory not being freed.
This was breaking the installed object list creation as it would quickly run out of rct2 memory. Scenario text was incorrectly using rct2_free this has also been fixed.
This commit is contained in:
parent
2c58910f62
commit
a8a8385899
|
@ -1593,7 +1593,7 @@ int object_get_scenario_text(rct_object_entry *entry)
|
|||
void object_free_scenario_text()
|
||||
{
|
||||
if (RCT2_GLOBAL(RCT2_ADDRESS_SCENARIO_TEXT_TEMP_CHUNK, void*) != NULL) {
|
||||
rct2_free(RCT2_GLOBAL(RCT2_ADDRESS_SCENARIO_TEXT_TEMP_CHUNK, void*));
|
||||
free(RCT2_GLOBAL(RCT2_ADDRESS_SCENARIO_TEXT_TEMP_CHUNK, void*));
|
||||
RCT2_GLOBAL(RCT2_ADDRESS_SCENARIO_TEXT_TEMP_CHUNK, void*) = NULL;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -512,9 +512,9 @@ void *rct2_realloc(void *block, size_t numBytes)
|
|||
|
||||
/**
|
||||
* RCT2 and this DLL can not free each other's allocated memory blocks. Use this to free memory that was allocated by RCT2.
|
||||
* rct2: 0x004068DE
|
||||
* rct2: 0x004068CD
|
||||
*/
|
||||
void rct2_free(void *block)
|
||||
{
|
||||
RCT2_CALLPROC_1(0x004068DE, void*, block);
|
||||
RCT2_CALLPROC_1(0x004068CD, void*, block);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue