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



--- Comment #5 from Witold Baryluk <bary...@smp.if.uj.edu.pl> 2009-11-25 
06:11:41 PST ---
Ok, i now i solved it using kind of hack:

/** This class is written because Fiber's are not correctly garbage collected
*/
class GenWrap(T : AGenerator, T2) {
    private T x; /// T derives from AGenerator which derives from Fiber
public:
    this(T x_) { x = x_; }
    ~this() { delete x; }
    T2 getNext() { return x.getNext(); }
    T o() { return x; } // don't assign return value to any variable which can
live longer than this object
}

This is hack, because it can destroy Fibers which are still referenced
somewhere. So All my direct usages of variables of type T, must be changed to
use GenWrap.o(), to be sure that delete x inside destructor is safe.

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

Reply via email to