still confused with QTsignal

Phil Thompson phil at river-bank.demon.co.uk
Mon Jan 21 05:46:17 EST 2002


root wrote:
> 
> > That looks suspicious. Don't you mean...
> >
> >           self.m=mixer(self)
> >
> Thanks Phil,
> 
> That has cured the problem. I am new to python (only 2 weeks in) and I
> thought that if I was only using a varialble in a class as a local variable
> then i didn't need 'self', obviosly not

The problem is garbage collection. Because your 'm' reference was being
deleted when it went out of scope, the mixer instance was also deleted
because that was the only reference to it. self.m stays alive, so the
mixer instance also stays alive.

Phil




More information about the Python-list mailing list