Mercurial > projects > dwt-win
comparison dwt/graphics/Resource.d @ 334:c49e17d48b76
Fix problems at GC run at main()'s end.
author | Frank Benoit <benoit@tionex.de> |
---|---|
date | Wed, 18 Feb 2009 16:14:31 +0100 |
parents | 684eed7589a0 |
children | 47b37f126740 |
comparison
equal
deleted
inserted
replaced
333:684eed7589a0 | 334:c49e17d48b76 |
---|---|
39 * | 39 * |
40 * @since 3.1 | 40 * @since 3.1 |
41 */ | 41 */ |
42 public abstract class Resource { | 42 public abstract class Resource { |
43 | 43 |
44 /// DWT extension for D: do no dispose check | |
45 bool disposeChecking = true; | |
46 | |
44 /** | 47 /** |
45 * the device where this resource was created | 48 * the device where this resource was created |
46 */ | 49 */ |
47 Device device; | 50 Device device; |
48 | 51 |
54 if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); | 57 if (device is null) DWT.error(DWT.ERROR_NULL_ARGUMENT); |
55 this.device = device; | 58 this.device = device; |
56 } | 59 } |
57 | 60 |
58 ~this(){ | 61 ~this(){ |
59 if( !isDisposed ){ | 62 if( disposeChecking && !isDisposed() ){ |
60 //Trace.formatln("{} {} {} Resource deleted, but is not yet disposed", __FILE__, __LINE__, this.classinfo.name ); | 63 //Trace.formatln("{} {} {} Resource deleted, but is not yet disposed", __FILE__, __LINE__, this.classinfo.name ); |
61 DWT.error( 0, null, " Resource deleted, but is not yet disposed: (" ~ this.classinfo.name ~ ")" ); | 64 DWT.error( 0, null, " Resource deleted, but is not yet disposed: (" ~ this.classinfo.name ~ ") " ~ this.toString() ); |
62 } | 65 } |
63 } | 66 } |
64 | 67 |
65 void destroy() { | 68 void destroy() { |
66 } | 69 } |