Skip to content

Commit

Permalink
Don't call FreeInstance() if component == NULL (#626)
Browse files Browse the repository at this point in the history
  • Loading branch information
t-sommer authored Nov 11, 2024
1 parent a045e41 commit 4c30c5b
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion fmusim/FMI1CSSimulation.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ FMIStatus FMI1CSSimulate(const FMISimulationSettings* s) {
}
}

if (status != FMIFatal) {
if (status != FMIFatal && S->component) {
FMI1FreeSlaveInstance(S);
}

Expand Down
2 changes: 1 addition & 1 deletion fmusim/FMI1MESimulation.c
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ FMIStatus FMI1MESimulate(const FMISimulationSettings* s) {
}
}

if (status != FMIFatal) {
if (status != FMIFatal && S->component) {
FMI1FreeModelInstance(S);
}

Expand Down
2 changes: 1 addition & 1 deletion fmusim/FMI2CSSimulation.c
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,7 @@ FMIStatus FMI2CSSimulate(const FMISimulationSettings* s) {
}
}

if (status != FMIFatal) {
if (status != FMIFatal && S->component) {
FMI2FreeInstance(S);
}

Expand Down
2 changes: 1 addition & 1 deletion fmusim/FMI2MESimulation.c
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ FMIStatus FMI2MESimulate(const FMISimulationSettings* s) {
}
}

if (status != FMIFatal) {
if (status != FMIFatal && S->component) {
FMI2FreeInstance(S);
}

Expand Down
2 changes: 1 addition & 1 deletion fmusim/FMI3CSSimulation.c
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ FMIStatus FMI3CSSimulate(const FMISimulationSettings* s) {
}
}

if (status != FMIFatal) {
if (status != FMIFatal && S->component) {
FMI3FreeInstance(S);
}

Expand Down
2 changes: 1 addition & 1 deletion fmusim/FMI3MESimulation.c
Original file line number Diff line number Diff line change
Expand Up @@ -246,7 +246,7 @@ FMIStatus FMI3MESimulate(const FMISimulationSettings* s) {
}
}

if (status != FMIFatal) {
if (status != FMIFatal && S->component) {
FMI3FreeInstance(S);
}

Expand Down

0 comments on commit 4c30c5b

Please sign in to comment.