Derelict SFML destructor crashes

Maxim Fomin maxim at maxim-fomin.ru
Sun Dec 16 06:59:31 PST 2012


On Sunday, 16 December 2012 at 14:42:57 UTC, Nekroze wrote:
> I am trying to do some wrapping of the CSFML derelict bindings 
> to classes however when i use the CSFML methods to destroy the 
> objects it causes a crash.
>
> I have made a post in the SFML>D forum because they have syntax 
> highlighting for D so this kind of post looks nicer but the 
> link is here:
>
> http://en.sfml-dev.org/forums/index.php?topic=10005.0
>
> There is a minimal code example there and a better explanation.
>
> Can anyone help me with why this is happening?

Why would you call a destroy() on a this object inside ~this()? 
And accessing allocated by GC objects inside destructor is not 
safe, because they may be collected before running the destructor.


More information about the Digitalmars-d-learn mailing list