GNOME Bugzilla – Bug 662133
Crashes python when using create_context()
Last modified: 2012-11-29 11:04:22 UTC
I can crash Python in Ubuntu 11.10 using gtksourceview 3.2.2: from gi.repository import GtkSource v = GtkSource.View() c = v.get_completion() ctx = c.create_context(None) dir(ctx) Seems that the object returned by create_context has a refcount of 0. This smells like another ref_sink issue.
mmm, maybe some annotation problem?
The gir says the returned object is transfer-full.
mmm, that might be the problem as the object an initiallyunkowned object.
I think that is correct though? InitiallyUnowned objects start with a floating ref. If it didn't say transfer-full, the object would end up being leaked because no one would take ownership of that floating ref, right? I was thinking that the python wrapper object is using ref_sink and then unrefs it too soon (i.e. before the object is out of scope).
I guess we should reassign this to pygobject
Confirmed with 3.2.
This is fixed in 3.7.x with the dropping of the static GSource bindings.