[Issue 6167] RefCounted and lazy/delegate

d-bugmail at puremagic.com d-bugmail at puremagic.com
Thu Jun 16 16:05:20 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6167



--- Comment #1 from Jose Garcia <jsancio at gmail.com> 2011-06-16 16:00:39 PDT ---
Also, note that if change fun to not be a member function you get the
following:

struct Struct
{
   this(int dummy) { refCount = RefCounted!Impl(Impl(dummy)); }
   ~this() {}

   RefCounted!Impl refCount;

   struct Impl { int dummy; }
}

Struct fun()
{
   throw new Exception("");
}

//...


$ ../dmd/dmd/src/dmd -debug=RefCounted -w -gc ref_test.d
../dmd/phobos/std/typecons.d && ./ref_test
_RefCounted at 89A8410: initialized with (Impl _param_0)
RefCounted!(Impl)@89A8410: freeing... done!

Which is the expected result.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list