The following code crashes when built against gtkmm v2.24.4 (using MSVC) :-
    #include "gtkmm/main.h"
    #include "gtkmm/window.h"
    int main (int argc, char *argv[])
    {
     Gtk::Main   app (&argc, &argv);
     Gtk::Window  mainWnd;
        mainWnd.set_title("Hello World!");
        app.run( mainWnd );
        return 0;
    }
The crash occurs at shutdown, when object 'mainWnd' is getting destroyed (I believe "unrealized" is the gtkmm parlance). Â OTOH if I modify function main() to look like this, the code doesn't crash any more:-
    int main (int argc, char *argv[])
    {
     Gtk::Main   app (&argc, &argv);
     Gtk::Window*  mainWnd = new Gtk::Window;
        mainWnd->set_title("Hello World!");
        app.run( *mainWnd );
        return 0;
    }
whereas if I add my own 'delete' statement, it crashes in the same way as before, while executing 'delete' :-
    int main (int argc, char *argv[])
    {
     Gtk::Main   app (&argc, &argv);
     Gtk::Window*  mainWnd = new Gtk::Window;
        mainWnd->set_title("Hello World!");
        app.run( *mainWnd );
        delete mainWnd;  // <--- now crashes here !
        return 0;
    }
This suggests to me that gtkmm is deleting objects somewhere (a) without knowing whether or not it created them; Â and (b) without even knowing if they were created from the free store. Â FWIW if I adapt the code to use pure GTK+ functionality the problem goes away (i.e. if the same program gets implemented using GTK+ instead of gtkmm). Â I just wondered if this might ring any bells with anyone here?? Â Alarm bells, at least..! Â ;-) Â Thanks.
John
_______________________________________________
gtkmm-list mailing list
gtkmm-list gnome org
https://mail.gnome.org/mailman/listinfo/gtkmm-list