D wrapper classes leak memory. Next steps?

ketmar via Digitalmars-d digitalmars-d at puremagic.com
Fri Oct 31 01:51:04 PDT 2014


On Fri, 31 Oct 2014 09:46:54 +0100
Marco Leise via Digitalmars-d <digitalmars-d at puremagic.com> wrote:

> Can't blame the author when there is no other choice in the
> language than to use tracing GC with inheritance.
there are alot of choices. i'm succesfully using wrapper classes with
reference counting in my i/o streams library, for example. they are GC
roots, and they are freed in the same moment when their reference count
becomes zero.

> Which prompts the question again how to deal
> with exceptions in dtors.
class dtors should not throw any exceptions. stack-allocated struct
dtors can do what they want, just catch that and you'll got "nothrow"
function. what's the problem here?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20141031/b1eea057/attachment.sig>


More information about the Digitalmars-d mailing list