# HG changeset patch # User Frank Benoit # Date 1234282464 -3600 # Node ID 684eed7589a0e4784fde134720a2022cadac26c5 # Parent 1ee938a6e02e9471b8bd27311dadee5c3bc2bc21 Generate error if a resource is deleted without disposal. Without that, is is very hard to find accidental deleted/scoped Color/Font/.. diff -r 1ee938a6e02e -r 684eed7589a0 dwt/graphics/Resource.d --- a/dwt/graphics/Resource.d Sun Feb 01 19:40:09 2009 +0100 +++ b/dwt/graphics/Resource.d Tue Feb 10 17:14:24 2009 +0100 @@ -14,6 +14,7 @@ import dwt.DWT; import dwt.graphics.Device; +//import tango.util.log.Trace; /** * This class is the abstract superclass of all graphics resource objects. @@ -54,6 +55,13 @@ this.device = device; } +~this(){ + if( !isDisposed ){ + //Trace.formatln("{} {} {} Resource deleted, but is not yet disposed", __FILE__, __LINE__, this.classinfo.name ); + DWT.error( 0, null, " Resource deleted, but is not yet disposed: (" ~ this.classinfo.name ~ ")" ); + } +} + void destroy() { }