Skip to content

Commit

Permalink
Fix TSRM ignoring done
Browse files Browse the repository at this point in the history
  • Loading branch information
krakjoe committed Jan 11, 2022
1 parent 703cac3 commit d7db5f6
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions TSRM/TSRM.c
Original file line number Diff line number Diff line change
Expand Up @@ -188,11 +188,16 @@ TSRM_API void tsrm_shutdown(void)
next_p = p->next;
for (j=0; j<p->count; j++) {
if (p->storage[j]) {
if (resource_types_table && !resource_types_table[j].done && resource_types_table[j].dtor) {
resource_types_table[j].dtor(p->storage[j]);
}
if (!resource_types_table[j].fast_offset) {
free(p->storage[j]);
if (resource_types_table) {
if (!resource_types_table[j].done) {
if (resource_types_table[j].dtor) {
resource_types_table[j].dtor(p->storage[j]);
}

if (!resource_types_table[j].fast_offset) {
free(p->storage[j]);
}
}
}
}
}
Expand Down Expand Up @@ -531,11 +536,13 @@ void ts_free_id(ts_rsrc_id id)

while (p) {
if (p->count > j && p->storage[j]) {
if (resource_types_table && resource_types_table[j].dtor) {
resource_types_table[j].dtor(p->storage[j]);
}
if (!resource_types_table[j].fast_offset) {
free(p->storage[j]);
if (resource_types_table) {
if (resource_types_table[j].dtor) {
resource_types_table[j].dtor(p->storage[j]);
}
if (!resource_types_table[j].fast_offset) {
free(p->storage[j]);
}
}
p->storage[j] = NULL;
}
Expand Down

0 comments on commit d7db5f6

Please sign in to comment.