Am 03.05.2014 16:02, schrieb "Ola Fosheim Grøstad" <ola.fosheim.grostad+dl...@gmail.com>":
On Saturday, 3 May 2014 at 13:21:04 UTC, Paulo Pinto wrote:
C# and Java also have scoped blocks (using, try-with-resources),
similar to Python for resource management.

Yeah,  but it doesn't work for graphs that maintain resources, such as a
scene graph which hold onto texture memory. Unfortunately, you don't
want GC collection to release it either.

I think in most cases resources can either be handled by owned pointers
or a regional GC (in this case a GC that only trace SceneNodePointers).

Why not?

- Make all scene graph nodes IDisposable.

- Have a using(rootNode) {} on your render loop

--
Paulo

Reply via email to