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 738653 - assertion 'value->ref_count > 0' failed on return after activating action
assertion 'value->ref_count > 0' failed on return after activating action
Status: RESOLVED DUPLICATE of bug 735166
Product: pygobject
Classification: Bindings
Component: gobject
3.12.x
Other Linux
: Normal normal
: ---
Assigned To: Nobody's working on this now (help wanted and appreciated)
Python bindings maintainers
Depends on:
Blocks:
 
 
Reported: 2014-10-16 21:14 UTC by Arnaud Gardelein
Modified: 2014-10-18 02:45 UTC
See Also:
GNOME target: ---
GNOME version: ---



Description Arnaud Gardelein 2014-10-16 21:14:43 UTC
When running the code hereafter, a warning appears only the first time the button is clicked:
/usr/lib/python3/dist-packages/gi/overrides/GLib.py:222: Warning: g_variant_unref: assertion 'value->ref_count > 0' failed
Interestingly on subsequent click the warning never appear again.

------- Code

#!/usr/bin/python3

from gi.repository import Gtk, Gio, Gdk, GLib
import sys

class MyWindow(Gtk.ApplicationWindow):
    def __init__(self, app):
        Gtk.Window.__init__(self, title="Welcome to GNOME", application=app)
        b = Gtk.Button('Click to activate action')
        self.add(b)
        b.connect('clicked', self.btn_clicked)

    def btn_clicked(self, widget):
        print('clicked')
        param = GLib.Variant.new_tuple(GLib.Variant.new_string('a'),
                                       GLib.Variant.new_string('b'),
                                       GLib.Variant.new_uint64(1))
        app.activate_action('insert_signal', param)
        print('before delete')
        del param
        print('after delete')

class MyApplication(Gtk.Application):
    def __init__(self):
        Gtk.Application.__init__(self)

    def do_activate(self):
        win = MyWindow(self)
        win.show_all()

    def do_startup(self):
        Gtk.Application.do_startup(self)
        
        a = Gio.SimpleAction.new('insert_signal', GLib.VariantType.new('(sst)'))
        a.connect('activate', self.insert_signal_activated)
        self.add_action(a)

    def insert_signal_activated(self, action, param):
        (sigs, figname, gnum) = param.unpack()
        print(sigs, figname, gnum)

app = MyApplication()
exit_status = app.run(sys.argv)
sys.exit(exit_status)
Comment 1 Simon Feltman 2014-10-18 02:45:21 UTC
Thanks for taking the time to log this. It's actually already been fixed in 3.14.

*** This bug has been marked as a duplicate of bug 735166 ***