How to write a proper class destructor?
Bradley Smith
digitalmars-com at baysmith.com
Wed Jan 24 22:48:43 PST 2007
According to the documentation, a class destructor is "expected to
release any resources held by the object."[1] However, if resources to
be released are in objects to be garbage collected, "those references
are no longer valid."[1]
How is a class supposed to release something for which it no longer has
a valid reference?
Bradley
[1] http://www.digitalmars.com/d/class.html#destructors.
More information about the Digitalmars-d-learn
mailing list