Re: Is gtkmm deleting stuff it shouldn't be deleting ??



On Sat, 2013-11-02 at 14:55 +0000, John Emmas wrote:
The following code crashes when built against gtkmm v2.24.4 (using MSVC) :-

This is with the gtkmm that you have built yourself, right, and from
git, not from a tarball?

         #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

Do you have a backtrace?

 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:-
[snip]

If you are the only one who can reproduce this then I'm afraid you will
need to do some investigtion yourself. If this was happening for other
people they would notice rather quickly.

At the very least, you might derive a Gtk::Window and put some std::cout
output in its destructor, to see when that is being called.

You could also try to handle the underlying GtkWidget's "destroy"
signal. If that is being emitted too soon, you could investigate why.



-- 
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com



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