Doom64EX icon indicating copy to clipboard operation
Doom64EX copied to clipboard

Fixed 'noreturn' function 'app::main' returning after wadgen finished

Open rkubes opened this issue 5 years ago • 1 comments

This was leading to undefined behavior after wadgen completed. app::main is a noreturn function, but WGen_WadgenMain would return after completing.

On my system the Release build would segfault after generating the wads, and the Debug build would launch the main game loop after generating the wads. The expected behavior is the app should gracefully exit after generating the wads.

This fix required an exit(0) to be called from within WGen_WadgenMain, and I felt the call logically belonged in the WGen_ShutDownApplication function. Furthermore, both functions are now appropriate marked as noreturn.

rkubes avatar Aug 03 '19 04:08 rkubes

Oops. I just saw #87 So this pull request will actually fix the issue reported in #87, but it seems the project is shifting away from using wadgen. I'll leave the Pull Request open for now in case there's a desire to merge this in ahead of the move to using the rom directly.

rkubes avatar Aug 17 '19 02:08 rkubes