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?
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. 2013/5/13 Benjamin Thaut <c...@benjamin-thaut.de> > 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. > > int[3] staticArray; > int[] normalArray = staticArray[]; > > > 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?) > > 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. > > Kind Regards > Benjamin Thaut > >