Changeset 13830


Ignore:
Timestamp:
Oct 23, 2019 9:46:39 PM (3 weeks ago)
Author:
Christian Andersson
Message:

Updated C codegen for the external object constructor. Related to ticket:5863

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/dev-cw-2613/Compiler/ModelicaCBackEnd/src/jastadd/CCodeGen/CCodeGenGlobals.jrag

    r13099 r13830  
    545545            String strName = v.type().name() + ".destructor";
    546546            FCallable c = getName().lookupFCallable(strName);
     547            str.formatln("%sif (%s != NULL) {", indent, FExp.global_C(v.nameUnderscore()));
    547548            str.print(indent, c.funcNameUnderscore(C_SUFFIX_DEF), "(", FExp.global_C(v.nameUnderscore()), ");\n");
     549            str.formatln("%s%s = NULL;", p.indent(indent), FExp.global_C(v.nameUnderscore()));
     550            str.formatln("%s}", indent);
    548551        }
    549552    }
Note: See TracChangeset for help on using the changeset viewer.