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 733610 - g_object_unref exceptions using GtkNotebook
g_object_unref exceptions using GtkNotebook
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Accessibility
unspecified
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2014-07-23 16:04 UTC by Alejandro Piñeiro Iglesias (IRC: infapi00)
Modified: 2014-07-25 08:06 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Unref selected item only if it is not NULL (1.03 KB, patch)
2014-07-23 16:08 UTC, Alejandro Piñeiro Iglesias (IRC: infapi00)
reviewed Details | Review
Unref selected item only if it is not NULL (v2) (1.22 KB, patch)
2014-07-24 08:22 UTC, Alejandro Piñeiro Iglesias (IRC: infapi00)
committed Details | Review

Description Alejandro Piñeiro Iglesias (IRC: infapi00) 2014-07-23 16:04:36 UTC
HOW TO REPRODUCE:

  1. Have any accessible tool (ie: Orca) running
  2. Execute evince on a terminal to any pdf
  3. You will get messages like this:
   (lt-evince:1366): GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed
Comment 1 Alejandro Piñeiro Iglesias (IRC: infapi00) 2014-07-23 16:08:20 UTC
Created attachment 281489 [details] [review]
Unref selected item only if it is not NULL

The accessible for each individual notebook page was asking to the notebook the selected page in order to check if that page should have the state SELECTED or not. After that check, it was unrefing the selected page. But the selection can be NULL. 

This patch just adds a NULL check, to avoid calling g_object_unref on it.
Comment 2 Emmanuele Bassi (:ebassi) 2014-07-23 16:27:19 UTC
Review of attachment 281489 [details] [review]:

looks generally good to me, but maybe you want to do something like:

    selected = ...
    if (selected)
      {
        if (selected == accessible)
          atk_state_set_add_state (...);

        g_object_unref (selected);
      }
Comment 3 Alejandro Piñeiro Iglesias (IRC: infapi00) 2014-07-24 08:22:31 UTC
Created attachment 281550 [details] [review]
Unref selected item only if it is not NULL (v2)

Updated patch based on Emmanuele Bassi review.
Comment 4 Matthias Clasen 2014-07-25 02:04:58 UTC
Review of attachment 281550 [details] [review]:

ok