Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deleting vessel cause crash when running with external graphic client #145

Closed
spacex15 opened this issue Sep 26, 2021 · 3 comments
Closed

Comments

@spacex15
Copy link
Contributor

spacex15 commented Sep 26, 2021

Testing on the d3d9client branch

The external graphic client clbkDeleteVessel is never called by orbiter core

I got a crash running in debug mode because of this

I suggest to change the following code in orbiter.cpp

#ifdef INLINEGRAPHICS
oclient->clbkDeleteVessel ((OBJHANDLE)vessel);
#endif

to

#ifdef INLINEGRAPHICS
oclient->clbkDeleteVessel ((OBJHANDLE)vessel);
#else
if(gclient)
gclient->clbkDeleteVessel((OBJHANDLE)vessel);
#endif

same problem exists with other virtual module functions

Or maybe the d3d9client should register these functions ?

@riojax
Copy link
Contributor

riojax commented Jan 11, 2022

Please, can you retest it?

@spacex15
Copy link
Contributor Author

Thanks for implementing this

Yes it will work (although I must admit I tested on jarmonik/d3d9client repo branch,
I wonder why this new d3d9client version is still to be merged into main repo )

Please note that the same issue occurs in 3 other locations in orbiter.cpp
for the newvessel ,vesseljump and timejump events

see below the suggested fixes

#ifdef INLINEGRAPHICS
oclient->clbkNewVessel ((OBJHANDLE)vessel);
#else
if (gclient)
gclient->clbkNewVessel((OBJHANDLE)vessel);
#endif // INLINEGRAPHICS

#ifdef INLINEGRAPHICS
oclient->GetScene()->Update (g_psys, &g_camera[0], 1, false/m_bRunning/, false);
#else
if (gclient)
gclient->clbkVesselJump((OBJHANDLE)obj);
#endif // INLINEGRAPHICS

#ifdef INLINEGRAPHICS
if (oclient) oclient->clbkTimeJump (td.SimT0, tjump.dt, _mjd);
#else
if (gclient)
gclient->clbkTimeJump(td.SimT0, tjump.dt, _mjd);
#endif

@riojax
Copy link
Contributor

riojax commented Jan 12, 2022

Thank you a lot, this is a huge PR with all your suggested fixes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants