[Twisted-Python] Woven application, objects not collected.
syver-en at online.no
Tue Nov 25 15:52:43 EST 2003
Jp Calderone <exarkun at intarweb.us> writes:
> On Tue, Nov 25, 2003 at 02:56:26PM +0100, Syver Enstad wrote:
> > Pseudo code:
> > class Page:
> > def initialize(self, ...):
> > self._deferred = defer.succeed([1, 2, 3])
> > def wmfactory_oneTwoThree(self, request):
> > return self._deferred
Hi Jp. It seems that changing the wmfactory_method to do:
def wmfactory_oneTwoThree(self, request):
deferred = defer.Deferred()
Does the trick.
> Presumably at some later point you will have a line like
> "self._deferred.callback(value)". Immediately after this (actually,
> is preferable, how is left as an exercise for the reader), you
> should "self._deferred = None". The cycle will be broken and the
> garbage will be collectable.
More information about the Twisted-Python