Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 390260 - Replace gdk_cursor_unref with g_object_unref for Gtk 3.0+
Summary: Replace gdk_cursor_unref with g_object_unref for Gtk 3.0+
Status: RESOLVED FIXED
Alias: None
Product: Platform
Classification: Eclipse Project
Component: SWT (show other bugs)
Version: 4.2   Edit
Hardware: PC Linux
: P3 normal (vote)
Target Milestone: 4.3 M3   Edit
Assignee: Alexander Kurtakov CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks: 340067
  Show dependency tree
 
Reported: 2012-09-24 15:08 EDT by Anatoly Spektor CLA
Modified: 2012-10-24 14:40 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Anatoly Spektor CLA 2012-09-24 15:08:23 EDT
This patch replaces gdk_cursor_unref with g_object_unref and removes gdk_cursor_unref:

http://fedorapeople.org/cgit/aspektor/public_git/eclipse.platform.swt.git/commit/?h=gdk_cursor_unref
Comment 1 Alexander Kurtakov CLA 2012-10-01 19:51:58 EDT
Looking at http://git.gnome.org/browse/gtk+/tree/gdk/x11/gdkcursor-x11.c?h=gtk-2-24#n422 and http://git.gnome.org/browse/gtk+/tree/gdk/x11/gdkcursor-x11.c?h=gtk-2-24#n283 (GTK2) and http://git.gnome.org/browse/gtk+/tree/gdk/gdkcursor.c#n289 and http://git.gnome.org/browse/gtk+/tree/gdk/x11/gdkcursor-x11.c#n240 (GTK3) shows that - GTK2 version is not using GObject at all.
As a result g_object_unref will receive non GObject pointer.
Please keep gdk_cursor_unref for pre GTK3 and g_object_unref for GTK3 and newer.
Comment 2 Anatoly Spektor CLA 2012-10-02 09:06:04 EDT
(In reply to comment #1)
> Looking at
> http://git.gnome.org/browse/gtk+/tree/gdk/x11/gdkcursor-x11.c?h=gtk-2-
> 24#n422 and
> http://git.gnome.org/browse/gtk+/tree/gdk/x11/gdkcursor-x11.c?h=gtk-2-
> 24#n283 (GTK2) and
> http://git.gnome.org/browse/gtk+/tree/gdk/gdkcursor.c#n289 and
> http://git.gnome.org/browse/gtk+/tree/gdk/x11/gdkcursor-x11.c#n240 (GTK3)
> shows that - GTK2 version is not using GObject at all.
> As a result g_object_unref will receive non GObject pointer.
> Please keep gdk_cursor_unref for pre GTK3 and g_object_unref for GTK3 and
> newer.

Thanks for your comments, please refer to the patch below:

http://fedorapeople.org/cgit/aspektor/public_git/eclipse.platform.swt.git/commit/?h=gdk_cursor_unref_64
Comment 3 Alexander Kurtakov CLA 2012-10-02 13:53:02 EDT
Looks good now. Pushed to master. http://git.eclipse.org/c/platform/eclipse.platform.swt.git/commit/?id=ffe5186c17b22da6dd8ec55ad2dd5f424adf803a

Thanks for the patch.