After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 630719 - Adapt to latest GTK+: GtkObject was removed
Adapt to latest GTK+: GtkObject was removed
Status: RESOLVED FIXED
Product: gtksourceview
Classification: Platform
Component: General
2.90.x
Other Linux
: Normal normal
: ---
Assigned To: GTK Sourceview maintainers
GTK Sourceview maintainers
Depends on:
Blocks:
 
 
Reported: 2010-09-27 11:51 UTC by Javier Jardón (IRC: jjardon)
Modified: 2010-09-28 12:08 UTC
See Also:
GNOME target: 3.0
GNOME version: ---


Attachments
Adapt to latest GTK+: GtkObject was removed (4.21 KB, patch)
2010-09-27 11:52 UTC, Javier Jardón (IRC: jjardon)
none Details | Review
rebased and updated patch (4.60 KB, patch)
2010-09-27 22:52 UTC, José Aliste
none Details | Review

Description Javier Jardón (IRC: jjardon) 2010-09-27 11:51:51 UTC
Patch following
Comment 1 Javier Jardón (IRC: jjardon) 2010-09-27 11:52:20 UTC
Created attachment 171192 [details] [review]
Adapt to latest GTK+: GtkObject was removed
Comment 2 Paolo Borelli 2010-09-27 12:00:27 UTC
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
Comment 3 jessevdk@gmail.com 2010-09-27 20:49:46 UTC
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.
Comment 4 José Aliste 2010-09-27 22:52:43 UTC
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.
Comment 5 Javier Jardón (IRC: jjardon) 2010-09-28 01:19:01 UTC
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
Comment 6 jessevdk@gmail.com 2010-09-28 05:31:19 UTC
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...
Comment 7 Paolo Borelli 2010-09-28 12:08:15 UTC
Pushed with further changes (e.g. get rid of destroy and switch to dipose) so that at least build is fixed.