On Monday, 18 September 2017 at 20:55:21 UTC, Sasszem wrote:
If I write "auto a = new De()", then it calls the scope first,
no matter where I place it.
Because with `new`
a) your struct object is located on the heap (and referred to by
pointer - `De*`) instead of the stack (which means no de
On Monday, 18 September 2017 at 20:55:21 UTC, Sasszem wrote:
On Monday, 18 September 2017 at 20:30:20 UTC, Jerry wrote:
On Monday, 18 September 2017 at 20:26:05 UTC, Sasszem wrote:
[...]
It's called inbetween the destructors of wherever you put the
scope(exit).
import std.stdio;
struct D
On Monday, 18 September 2017 at 20:30:20 UTC, Jerry wrote:
On Monday, 18 September 2017 at 20:26:05 UTC, Sasszem wrote:
[...]
It's called inbetween the destructors of wherever you put the
scope(exit).
import std.stdio;
struct De
{
~this() { writeln("De"); }
}
void main()
{
On Monday, 18 September 2017 at 20:26:05 UTC, Sasszem wrote:
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 des
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) state