If I close one of the apps I've written with them, it generates an access violation error within the SDL2 library. This doesn't happen with others, probably depending on what kind of resources I use. However, I just found a fix to the issue: if I manually call the dtor of the main logic after it exited from the main loop and remove the call for SDL2_QUIT(), there's no issues with SDL2, even the time it takes to quit it back to normal instead of the almost instant crash upon trying to close the application.
Odd behavior found in GC when terminating application
solidstate1991 via Digitalmars-d Fri, 05 Jan 2018 06:25:54 -0800
I usually write my applications' main logic into one or more
classes unless it can be avoided, and thus I often use ctors and
dtors for initializing and cleaning up things. One of them (my
engine) uses dtors for cleaning up things from a non-GC external
library (SDL2, using the Derelict loader).
- Odd behavior found in GC when terminati... solidstate1991 via Digitalmars-d
- Re: Odd behavior found in GC when ... Adam D. Ruppe via Digitalmars-d
- Re: Odd behavior found in GC w... Jonathan M Davis via Digitalmars-d
- Re: Odd behavior found in GC w... 12345swordy via Digitalmars-d
- Re: Odd behavior found in ... H. S. Teoh via Digitalmars-d
- Re: Odd behavior found in ... Meta via Digitalmars-d
- Re: Odd behavior found... 12345swordy via Digitalmars-d
- Re: Odd behavior ... Meta via Digitalmars-d
- Re: Odd behavior found in ... Jonathan M Davis via Digitalmars-d
