Gio::Action lookup crash



Hi,

I have this simple program :

#include <gtkmm.h>
#include <iostream>

class App: public Gtk::ApplicationWindow
{
        public:
                App()
                {
                        add_action("int");
                        auto la = lookup_action("int");
                        std::cout << bool(la) << std::endl;
                }
};

int main(int argc, char *argv[])
{
        auto app = Gtk::Application::create(argc, argv, "test.gtk");
        App win;
        return app->run(win);
}

The expected output is "1", but instead I get twice this message: "GLib-Object-CRITICAL **: g_object_get_qdata: assertion 'G_IS_OBJECT (object)' failed" and then the application crashes.


If I add the action to a Gio::SimpleActionGroup instead, it works.

I tested with Gtkmm 3.10 on Linux and 3.18 on Windows.

What am I doing wrong?

Thanks,
yann


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]