orbitersim / orbiter

Open-source repository of Orbiter Space Flight Simulator

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Terrain toolbox crashes in Release mode

parzival2 opened this issue · comments

The Terrain Toolbox crashes in Release mode but works perfectly fine in Debug.
Unfortunately the logs are not helpful. I have added few logs to figure out where the problem might be happening

oapiWriteLog("[TerrainToolbox] Initialize");
g_pCore = pCore = gcGetCoreInterface();
oapiWriteLogV("[TerrainToolbox] after gcGetCoreInterface %p", g_pCore);

The few last lines are as follows

000012.612: Loading module LuaInline
000012.909: Module ShuttleA.dll .......... [Build 221209, API 221209]
000013.042: Module ShuttlePB.dll ......... [Build 221209, API 221209]
000013.120: Finished initialising status
000013.120: Finished initialising camera
000013.129: Finished setting up render state
000013.149: D3D9: [Scene Initialized]
000013.187: Finished initialising panels
000013.433: D3D9: NewShader [DG\deltaglider_ns]=4
000021.735: [TerrainToolbox] OpenToolsClbk
000021.736: [TerrainToolbox] Initialize

As we can see it fails while gcGetCoreInterface(), specifically while initializing gcCore2 if (pBindCoreMethod) return (pCoreInterface = new gcCore2());
Does anyone know what might be happening?

Thanks for the report. This issue should be fixed now. The exact reason for failing in release mode remains unclear. Correct value was assigned to a global variable but it was reading as NULL in release mode causing a crash. Could it be due to code optimizations somehow.

If everything works alright then the issue can be closed.

Thank you for fixing it this quickly. I am also thinking the same that it might be caused due to optimizations in Release mode. Its working now so this issue can be closed.