On Thursday, 29 May 2014 at 13:01:50 UTC, Szymon Gatner wrote:
- point 5 (of How to do it...) says: "... and free the object if necessary", but then in code:
Sorry, I typed this answer but forgot to actually post it. But to keep the example focused on postblit and destructor stuff instead of malloc/free so I used the writeln instead of the actual calls.
So all you'd have to do is do free() where it says "Destroyed" instead and alloc in the ctor.