scope(exit) and destructor prioity

Sasszem mch at atw.hu
Mon Sep 18 20:26:05 UTC 2017


I'm currently working on a project and for that I've created a 
thin OO-wrapper on top of derelict-sdl. However, when I close my 
app, the program terminates with a segfault. I've managed to 
track down the source, and found that the destructors of my 
objects are called AFTER the scope(exit) statements. This causes 
my program to call TTF_CloseFont() after TTF_Quit(), resulting in 
a segfault.
My questions:
  - Can I force D to call the destructors BEFORE the scope(exit) 
statements?
  - If not, is there a way around?


More information about the Digitalmars-d-learn mailing list