GNOME Bugzilla – Bug 630719
Adapt to latest GTK+: GtkObject was removed
Last modified: 2010-09-28 12:08:15 UTC
Patch following
Created attachment 171192 [details] [review] Adapt to latest GTK+: GtkObject was removed
As said on irc this needs careful checking of the object lifecycle: on the patch you showed on irc you did GtkObject -> GObject and I mentioned that it *could* be more correct to use GInitiallyUnowned. Before committing the change it needs reviewing of the code to understand the current refcount of completion objects
Some more comments, there is a bug actually in GtkSourceCompletion (I don't think it was ever intended to inherit from GtkObject). The parent and type are GtkObject, but the actual parent class is GObjectClass... That this still works is a miracle. I think however that Gsc should be a GObject and not a GInitiallyUnowned since the only place we use it is in GtkSourceView and we do an explicit sink there anyway. I'd say to make it a GObject and to remove the ref sink.
Created attachment 171239 [details] [review] rebased and updated patch I took jjardon's patch, rebased it and addressed comments of Jessevdk. I also patched test-completion.c, which the previous patch did not.
Review of attachment 171239 [details] [review]: Hello, thanks for update the patch, only a minor comment: ::: gtksourceview/gtksourcecompletion.c @@ +166,3 @@ static guint signals[LAST_SIGNAL] = { 0 }; +G_DEFINE_TYPE(GtkSourceCompletion, gtk_source_completion, G_TYPE_INITIALLY_UNOWNED); This should be G_TYPE_OBJECT
Review of attachment 171239 [details] [review]: ::: gtksourceview/gtksourceview.c @@ +5247,3 @@ { view->priv->completion = gtk_source_completion_new (view); + g_object_ref (view->priv->completion); Increasing the ref here will cause a leak. The initial ref is already owned by the view...
Pushed with further changes (e.g. get rid of destroy and switch to dipose) so that at least build is fixed.