DescentDevelopers / Descent3

Descent 3 by Outrage Entertainment
GNU General Public License v3.0
2.74k stars 231 forks source link

Fixed crash in dedicated server mode. #370

Closed pzychotic closed 1 month ago

pzychotic commented 1 month ago

Pull Request Type

Description

Going a bit out of a limb here, but I guess that this change fixes https://github.com/DescentDevelopers/Descent3/issues/217.

When running Descent3.exe -dedicated dedicated.cfg and just calling quit in the server console, the app will crash with the following callstack:

Descent3.exe!opengl_InitCache() Line 315
Descent3.exe!opengl_ResetCache() Line 1493
Descent3.exe!rend_ResetCache() Line 1902
Descent3.exe!FlushDataCache() Line 1887
Descent3.exe!FreeThisLevel() Line 1814
Descent3.exe!GameSequencer() Line 1298
Descent3.exe!PlayGame() Line 835
Descent3.exe!MainLoop() Line 598
Descent3.exe!Descent3() Line 555
Descent3.exe!oeD3Win32App::run() Line 145

I assume that the crash after a finished game round from #217 will also call FreeThisLevel() for cleanup and hit the same crash down the line.

Since the dedicated server never initializes the renderer, OpenGL stuff will also not be initialized. As you can see in the callstack, we end up in opengl_InitCache() which tries to call some OGL function pointers that are still nullptr, since they never got initialized.

Related Issues

Fixes #217

Screenshots (if applicable)

Checklist

Additional Comments