Skip to content

Commit

Permalink
fix ticket:5431
Browse files Browse the repository at this point in the history
- do NOT, i repeat, do NOT reset memory_pools->used in pool_free_extra_list
  as this will basically remove all the allocated stuff from the current
  memory pool
  • Loading branch information
adrpo committed Jul 7, 2019
1 parent 96cf577 commit ae23951
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion OMCompiler/SimulationRuntime/c/gc/memory_pool.c
Expand Up @@ -126,14 +126,19 @@ static int pool_free_extra_list(void)
if (NULL == memory_pools) {
return 0;
}

freelist = memory_pools->next;
while (freelist) {
list *next = freelist->next;
omc_alloc_interface.free_uncollectable(freelist->memory);
omc_alloc_interface.free_uncollectable(freelist);
freelist = next;
}
memory_pools->used = 0;

/* adropo: why on earth would you do this?!?
* See ticket #5431 for an error generated by this error.
* memory_pools->used = 0;
*/
memory_pools->next = 0;
return 0;
}
Expand Down

0 comments on commit ae23951

Please sign in to comment.