File tree Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Expand file tree Collapse file tree 1 file changed +17
-10
lines changed Original file line number Diff line number Diff line change @@ -188,11 +188,16 @@ TSRM_API void tsrm_shutdown(void)
188188 next_p = p -> next ;
189189 for (j = 0 ; j < p -> count ; j ++ ) {
190190 if (p -> storage [j ]) {
191- if (resource_types_table && !resource_types_table [j ].done && resource_types_table [j ].dtor ) {
192- resource_types_table [j ].dtor (p -> storage [j ]);
193- }
194- if (!resource_types_table [j ].fast_offset ) {
195- free (p -> storage [j ]);
191+ if (resource_types_table ) {
192+ if (!resource_types_table [j ].done ) {
193+ if (resource_types_table [j ].dtor ) {
194+ resource_types_table [j ].dtor (p -> storage [j ]);
195+ }
196+
197+ if (!resource_types_table [j ].fast_offset ) {
198+ free (p -> storage [j ]);
199+ }
200+ }
196201 }
197202 }
198203 }
@@ -531,11 +536,13 @@ void ts_free_id(ts_rsrc_id id)
531536
532537 while (p ) {
533538 if (p -> count > j && p -> storage [j ]) {
534- if (resource_types_table && resource_types_table [j ].dtor ) {
535- resource_types_table [j ].dtor (p -> storage [j ]);
536- }
537- if (!resource_types_table [j ].fast_offset ) {
538- free (p -> storage [j ]);
539+ if (resource_types_table ) {
540+ if (resource_types_table [j ].dtor ) {
541+ resource_types_table [j ].dtor (p -> storage [j ]);
542+ }
543+ if (!resource_types_table [j ].fast_offset ) {
544+ free (p -> storage [j ]);
545+ }
539546 }
540547 p -> storage [j ] = NULL ;
541548 }
You can’t perform that action at this time.
0 commit comments