Skip to content

Commit 71d3004

Browse files
authored
call free_instance on destruction (#148)
1 parent 641a5cb commit 71d3004

1 file changed

Lines changed: 2 additions & 7 deletions

File tree

include/fmi4cpp/fmu_instance_base.hpp

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,19 +70,13 @@ class fmu_instance_base : public virtual fmu_instance<model_description>
7070
return library_->reset(c_);
7171
}
7272

73-
bool terminate() override
74-
{
75-
return terminate(true);
76-
}
77-
78-
bool terminate(bool freeInstance)
73+
bool terminate()
7974
{
8075
if (!this->terminated_) {
8176
this->terminated_ = true;
8277
if (!library_->terminate(c_)) {
8378
return false;
8479
}
85-
this->free_instance();
8680
}
8781
return true;
8882
}
@@ -257,6 +251,7 @@ class fmu_instance_base : public virtual fmu_instance<model_description>
257251
~fmu_instance_base()
258252
{
259253
terminate();
254+
free_instance();
260255
}
261256
};
262257

0 commit comments

Comments
 (0)