[pygtk] Problems with improved garbage collection in PyGTK 2.11?

Sebastian Pölsterl marduk at k-d-w.org
Thu Sep 6 06:41:05 WST 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi!

I'm working on Deskbar-Appplet and ran into some problems using the
beagle handler. I discussed it thoroughly with the beagle maintainers
and it doesn't seem to be their fault, because the same code worked before.

What happens is:
I query beagle async like that:
<code>
def query(self, qstring):
	beagle_query = beagle.Query()
	beagle_query.add_text(qstring)
	beagle_query.connect("hits-added", self.hits_added_cb, qstring)
	self.beagle.send_request_async(beagle_query)
</code>
So the beagle_query variable is local.

The problem is that way I don't receive any results. Further
investigation revealed that the connection from beagle to deskbar is
closed before the results can be transmitted.

If I use self.beagle_query instead of beagle_query it works fine.

My assumption is that the garbage collector collects beagle_query at the
end of the method. If beagle wants to send its results it can't find the
object anymore, because it has been collected.
Whereas with self.beagle_query the object doesn't get collected and
everything works fine.

Please be aware that this is just an assumption, but if I'm right _and_
you can fix that bug I would be enormously happy.

- --
Greetings,
Sebastian Pölsterl
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG3zCB1ygZeJ3lLIcRAjySAJ9NhoBQwbJtoH60FdyopQgYmuvHzgCePzBR
D6oh8nnjLbdHdHRBC47KdfE=
=7vL1
-----END PGP SIGNATURE-----


More information about the pygtk mailing list