]> gerrit.simantics Code Review - simantics/fmil.git/commit
Ensure unloadFMU is called only if FMU instance (pointer) exists 46/3746/1 release/1.35.3
authorMiro Richard Eklund <miro.eklund@semantum.fi>
Tue, 14 Jan 2020 10:50:50 +0000 (12:50 +0200)
committerTuukka Lehtonen <tuukka.lehtonen@semantum.fi>
Tue, 21 Jan 2020 09:14:35 +0000 (09:14 +0000)
commit4ddacd7634d2b27911669977ac9611e4d4351115
tree1c4f5f1f14bcfae0ee2b849f4aca912599a34dc6
parent338cb520bf6ff2328f5cb8365f6c2abc02222e7a
Ensure unloadFMU is called only if FMU instance (pointer) exists

Previous assumptions of unloadFMU was that there was a valid C-level
pointer to cleanup and pass to the FMU model's cleanup functions.
However, if only loadFMU is called prior to unloadFMU, then JVM would
crash with an access violation exception. I introduced a boolean for
instantiated to keep track of this to ensure we avoid future crashes if
unloadFMU is called directly after loadFMU.

gitlab #13

Change-Id: Idef742d6805e856617c3c95c0bb751d8a48caa0d
(cherry picked from commit bc0dbe3b8e68fb3373b6b5865b69eccadad4b2fc)
org.simantics.fmil.core/src/org/simantics/fmil/core/FMIL.java