ClickteamLLC / windows-edif

Alternate, JSON-driven SDK for the Windows MMF2 runtime
23 stars 7 forks source link

Work around double call to init/free in F2.5 #18

Closed LB-- closed 9 years ago

LB-- commented 10 years ago

This attempts to work around CT#1650, which causes A/C/Es to be unlinked after creation of a sub-app and aso causes the global SDK object to be deleted upon destruction of any sub-app, which causes a crash the next time the global SDK pointer has to be dereferenced.

The workaround uses a static local variable to construct the global SDK object the first time and then assign its address to the global SDK pointer. It seems to work as expected, but might cause unexpected results if Fusion does not unload and reload the extension MFX after calling Free and before calling Initialize, though I have never been able to find a case where this happens (and I am very doubtful that this may happen in the future).

LB-- commented 9 years ago

I have tested and confirmed that this fixes #15, so it should be merged when possible.

looki commented 9 years ago

Nice - looks good.