Merge branch 'develop' into pr_fix_double_free_darray

This commit is contained in:
shahramn 2020-08-02 13:18:28 +01:00 committed by GitHub
commit 0ff3a687d3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 8 additions and 6 deletions

View File

@ -89,13 +89,15 @@ void grib_expression_print(grib_context* ctx, grib_expression* g, grib_handle* f
void grib_expression_free(grib_context* ctx, grib_expression* g)
{
grib_expression_class* c = g->cclass;
while (c) {
if (c->destroy)
c->destroy(ctx, g);
c = c->super ? *(c->super) : NULL;
if (g) {
grib_expression_class* c = g->cclass;
while (c) {
if (c->destroy)
c->destroy(ctx, g);
c = c->super ? *(c->super) : NULL;
}
grib_context_free_persistent(ctx, g);
}
grib_context_free_persistent(ctx, g);
}
void grib_expression_add_dependency(grib_expression* e, grib_accessor* observer)