svkaiser / Doom64EX

Doom64EX is a reverse-engineering project aimed to recreate Doom64 as close as possible with additional modding features.
http://doom64ex.wordpress.com/
GNU General Public License v2.0
237 stars 49 forks source link

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

Open rkubes opened 5 years ago

rkubes commented 5 years ago

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 commented 5 years ago

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.