Comment 30 for bug 120569

Revision history for this message
Hanno Stock (hefe_bia) (hanno-stock) wrote :

I am not an expert, but I do think this is a gnome-python-extras bug. A python object should live as long as there are any references held to it.
In this case the Spell object still holds a reference to the TextView object. So the Spell object should increase the reference counter on the TextView.

The "C" GtkSpell itself is not designed to live without a corresponding TextView. (gtkspell_detach even destroys the GtkSpell "C" object)
One could argue about the approach used in gtkspell but as of now most of the functions depend on the view. The change suggested by Gustavo Carneiro would make gtkspell more robust against such situations, but I think it's a bigger change.

In the test script above, if done correctly, the TextView would be destroyed automatically, when the GtkSpell object is destroyed. After the last line there is no reference hold to the GtkSpell object anymore and the GC would destroy them both.

Philipp Kern: I would be interested in your code that tried to fix the issue in gnome-python-extras.