Skip to content

Commit

Permalink
- Another Try to fix fmi tests.
Browse files Browse the repository at this point in the history
git-svn-id: https://openmodelica.org/svn/OpenModelica/trunk@16590 f25d12d1-65f4-0310-ae8a-bbce733d8d8e
  • Loading branch information
adeas31 committed Jul 13, 2013
1 parent e0c5d16 commit 4d96b7c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 4 additions & 2 deletions Compiler/runtime/FMIImpl.c
Original file line number Diff line number Diff line change
Expand Up @@ -686,19 +686,21 @@ void FMIImpl__releaseFMIImport(void *ptr1, void *ptr2, void *ptr3, const char* f
intptr_t fmiModeVariablesInstance = (intptr_t)RML_FETCH(RML_OFFSET(RML_UNTAGPTR(ptr1),1));
intptr_t fmiInstance = (intptr_t)RML_FETCH(RML_OFFSET(RML_UNTAGPTR(ptr2),1));
intptr_t fmiContext = (intptr_t)RML_FETCH(RML_OFFSET(RML_UNTAGPTR(ptr3),1));
fprintf(stderr, "fmiVersion = %s\n", fmiVersion);fflush(NULL);
if (strcmp(fmiVersion, "1.0") == 0) {
#if defined(__MINGW32__) || defined(_MSC_VER)
free((fmi1_import_variable_list_t*)fmiModeVariablesInstance);
#endif
fmi1_import_t* fmi = (fmi1_import_t*)fmiInstance;
fmi1_import_destroy_dllfmu(fmi);
fmi1_import_free(fmi);
} else if (strcmp(fmiVersion, "2.0") == 0) {
#if defined(__MINGW32__) || defined(_MSC_VER)
free((fmi2_import_variable_list_t*)fmiModeVariablesInstance);
#endif
fmi2_import_t* fmi = (fmi2_import_t*)fmiInstance;
fmi2_import_destroy_dllfmu(fmi);
fmi2_import_free(fmi);
}
fprintf(stderr, "fmiVersion 1 = %s\n", fmiVersion);fflush(NULL);
fmi_import_free_context((fmi_import_context_t*)fmiContext);
}

Expand Down
3 changes: 1 addition & 2 deletions Compiler/runtime/FMI_rml.c
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,7 @@ RML_END_LABEL

RML_BEGIN_LABEL(FMIExt__releaseFMIImport)
{
const char* fmiVersion = RML_STRINGDATA(rmlA3);
FMIImpl__releaseFMIImport(rmlA0, rmlA1, rmlA2, fmiVersion);
FMIImpl__releaseFMIImport(rmlA0, rmlA1, rmlA2, RML_STRINGDATA(rmlA3));
RML_TAILCALLK(rmlSC);
}
RML_END_LABEL

0 comments on commit 4d96b7c

Please sign in to comment.