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 706893 - Received a g_object_unref error using atspi_accessible_get_application
Received a g_object_unref error using atspi_accessible_get_application
Status: RESOLVED FIXED
Product: at-spi
Classification: Platform
Component: at-spi2-core
unspecified
Other Linux
: Normal normal
: ---
Assigned To: At-spi maintainer(s)
At-spi maintainer(s)
Depends on:
Blocks:
 
 
Reported: 2013-08-27 14:03 UTC by Alejandro Piñeiro Iglesias (IRC: infapi00)
Modified: 2013-08-27 16:30 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Test with a basic atspi listener (2.12 KB, text/x-csrc)
2013-08-27 14:03 UTC, Alejandro Piñeiro Iglesias (IRC: infapi00)
  Details
Remove unneeded unref (933 bytes, patch)
2013-08-27 14:09 UTC, Alejandro Piñeiro Iglesias (IRC: infapi00)
committed Details | Review

Description Alejandro Piñeiro Iglesias (IRC: infapi00) 2013-08-27 14:03:59 UTC
Created attachment 253248 [details]
Test with a basic atspi listener

Using the C test attached I get the following message:

"(process:31863): GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT (object)' failed"

I also see something similar executing a equivalent test written in python, but with a lot of python babblery.

I have a patch that solves this problem.

Note: probably it would be a good idea to include a test like this on at-spi2-core, as a example of how to use atspi API in C.
Comment 1 Alejandro Piñeiro Iglesias (IRC: infapi00) 2013-08-27 14:09:54 UTC
Created attachment 253252 [details] [review]
Remove unneeded unref

That unref is done inside an if with the next condition:

    if (!parent && obj->parent.app &&
        atspi_accessible_get_role (obj, NULL) != ATSPI_ROLE_APPLICATION)

as you can see, it checks parent. So inside the if, it will be NULL, so calling g_object_unref on it doesn't makes sense.
Comment 2 Mike Gorse 2013-08-27 16:16:15 UTC
Comment on attachment 253252 [details] [review]
Remove unneeded unref

Good catch. Yeah, that looks fine.