ataulien / GD3D11

D3D11-Renderer for Gothic and Gothic 2
GNU General Public License v3.0
175 stars 76 forks source link

The game doesn't exit properly #38

Open ThielHater opened 7 years ago

ThielHater commented 7 years ago

This should be well known and it would be great, if this could be fixed somehow.

jkelin commented 7 years ago

It would also be great if when right clicking on game on taskbar and selecting close, it would be closed.

BonneCW commented 6 years ago

Fixes for this are:

  1. GSky.cpp add NightTexture = nullptr; in c'tor. Otherwise it leads to random crashes when exiting the game as long as no NightTexture was loaded (e.g. from Main Menu)

  2. Remove deletion of DeferredContext in in d'tor of D3D11GraphicsEngineBase. This is more a hack than a fix, but shouldn't be a problem as it's done during shutdown only.

Katharsas commented 6 years ago

Nice work, but 2. doesn't work for me, even when i check out https://github.com/BonneCW/GD3D11/commit/0edfaba544f41747d193b6d77a1dcf2affee1293 i still get a crash (currently testing on G2).

Edit: When quitting from loaded game, log:

...
Info: Shutting down...
Info: Shut down RenderingThreadPool
Info: Shut down AntTweakBar
Info: D'Tor GothicAPI Start
Info: D'Tor GothicAPI ResetWorld
Info: D'Tor GothicAPI Ocean
Info: D'Tor GSky Start
Info: D'Tor GSky SkyPlaneVertexBuffer

When quitting from main menu before loading a game:

...
Info: D'Tor D3D11GraphicsEngine Start
BonneCW commented 6 years ago

Hm, weird, I tested with Odyssee and while it always hung up when leaving the game before the fix it works now. You're testing with plain G2?

EDIT: Ah, I see...

Katharsas commented 6 years ago

Yes plain G2. Only tested on AMD so far, will try NVidia too. Edit: Quitting without crash works on NVidia, just not on AMD