Destruction in DSFML2

(Compiled with dmd v2.051)

Code like this:


import dsfml.graphics.all;

void main()
{   
    while(true)
        auto rect = new Image(1024, 1024);
}

Errors per minute, causing an exception. I assume this is due to memory leaks.

Code like this causes access violations and / or exceptions:

import dsfml.graphics.all;

void main ()
{
    auto rect = new Image (1024, 1024);
    rect.dispose ();
}

What should I actually do with images and other similar classes? I would like to avoid memory leaks and .

+3
source share
1 answer

I can’t see the code right now, but I think that dispose () is not intended for general use.

, DSFML - CSFML, , , SFML. , . DSFML , , while (true).

, , SWIG, . , , , SFGUI.

+2

Source: https://habr.com/ru/post/1790577/


All Articles