Re: Odd Destructor Behavior

2016-02-08 Thread Matt Elkins via Digitalmars-d-learn
On Monday, 8 February 2016 at 07:31:07 UTC, Daniel Kozak wrote: Seems to me too, please report it on issues.dlang.org Reported: https://issues.dlang.org/show_bug.cgi?id=15661

Re: Odd Destructor Behavior

2016-02-07 Thread Daniel Kozak via Digitalmars-d-learn
V Sun, 07 Feb 2016 23:47:39 + Matt Elkins via Digitalmars-d-learn napsáno: > On Sunday, 7 February 2016 at 23:11:34 UTC, anonymous wrote: > > On 07.02.2016 23:49, Matt Elkins wrote: > >> Oi. Yes, I can, but it is quite a lot of code even if you > >>

Re: Odd Destructor Behavior

2016-02-07 Thread Márcio Martins via Digitalmars-d-learn
On Sunday, 7 February 2016 at 21:49:24 UTC, Matt Elkins wrote: I've been experiencing some odd behavior, where it would appear that a struct's destructor is being called before the object's lifetime expires. More likely I am misunderstanding something about the lifetime rules for structs. I

Odd Destructor Behavior

2016-02-07 Thread Matt Elkins via Digitalmars-d-learn
I've been experiencing some odd behavior, where it would appear that a struct's destructor is being called before the object's lifetime expires. More likely I am misunderstanding something about the lifetime rules for structs. I haven't been able to reproduce with a particularly minimal

Re: Odd Destructor Behavior

2016-02-07 Thread Matt Elkins via Digitalmars-d-learn
On Sunday, 7 February 2016 at 22:35:57 UTC, anonymous wrote: On 07.02.2016 23:07, Márcio Martins wrote: The destructor you are seeing is from the assignment: m_tileView = TileView(...); This creates a temporary TileView, copies it to m_tileView, and then destroys it. I suppose you want to

Re: Odd Destructor Behavior

2016-02-07 Thread anonymous via Digitalmars-d-learn
On 07.02.2016 22:49, Matt Elkins wrote: From this non-reduced situation, does anything jump out? Am I missing something about struct lifetimes? This is the only place I instantiate a TileView. Looks weird. I presume this doesn't happen with simpler constructor parameters/arguments, like int

Re: Odd Destructor Behavior

2016-02-07 Thread anonymous via Digitalmars-d-learn
On 07.02.2016 23:07, Márcio Martins wrote: The destructor you are seeing is from the assignment: m_tileView = TileView(...); This creates a temporary TileView, copies it to m_tileView, and then destroys it. I suppose you want to move it instead. You need to copy the handles from the temporary

Re: Odd Destructor Behavior

2016-02-07 Thread Matt Elkins via Digitalmars-d-learn
On Sunday, 7 February 2016 at 22:04:27 UTC, anonymous wrote: On 07.02.2016 22:49, Matt Elkins wrote: From this non-reduced situation, does anything jump out? Am I missing something about struct lifetimes? This is the only place I instantiate a TileView. Looks weird. I presume this doesn't

Re: Odd Destructor Behavior

2016-02-07 Thread anonymous via Digitalmars-d-learn
On 07.02.2016 23:49, Matt Elkins wrote: Oi. Yes, I can, but it is quite a lot of code even if you don't count that it is dependent on OpenGL, GLFW, and gl3n to run to this point. This is why I was disappointed that simpler reproducing cases weren't appearing. I should probably spend more time

Re: Odd Destructor Behavior

2016-02-07 Thread Matt Elkins via Digitalmars-d-learn
On Sunday, 7 February 2016 at 23:11:34 UTC, anonymous wrote: On 07.02.2016 23:49, Matt Elkins wrote: Oi. Yes, I can, but it is quite a lot of code even if you don't count that it is dependent on OpenGL, GLFW, and gl3n to run to this point. This is why I was disappointed that simpler

Re: Odd Destructor Behavior

2016-02-07 Thread Matt Elkins via Digitalmars-d-learn
Some environment information: DMD 2.070 32-bit Windows 7 (64-bit)