<div dir="ltr">But seeing as the memory only starts growing when I put the png line in, and that I keep deleting the old class and replacing it for a new instance, shouldn't the gc clean up everything as nothing can still be referencing to that data?<div>
<br></div><div style>I am working on windows, on linux my original code segfaulted, I don't know about the reduced version though. Afaik it doesn't use a platform dependent feature.</div></div><div class="gmail_extra">
<br><br><div class="gmail_quote">2013/5/13 Benjamin Thaut <span dir="ltr"><<a href="mailto:code@benjamin-thaut.de" target="_blank">code@benjamin-thaut.de</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Instead of the .dup you can use the slice operator []. Although this really should not cause a compiler crash if you forgett to do so.<br>
<br>
int[3] staticArray;<br>
int[] normalArray = staticArray[];<br>
<br>
<br>
I'm not seeing something fundamentally wrong with your code right now. I will most likely have some more time to look at it tomorrow. Does it use any plattform specific features? (E.g. does it work on windows?)<br>
<br>
Having a GC does not mean you can not have memory leaks. If you manage to keep the memory referenced by some hard rooted reference the GC is not allowed to free it and you will get a memory leak. I'm also currently not aware of any tools for D that will help you find memory leaks.<br>

<br>
Kind Regards<span class="HOEnZb"><font color="#888888"><br>
Benjamin Thaut<br>
<br>
</font></span></blockquote></div><br></div>