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



Thanks for the suggestions, Murray.

On 04/11/2013 08:20, Murray Cumming wrote:

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

Up until yesterday, yes. But yesterday I built gdkmm and gtkmm from the 2.4.4 tarball and got the same results. Over the next day or two I'll probably swap all my "mm" libraries to their tarball code and see if that changes anything.



Do you have a backtrace?

Not at the moment. MSVC isn't as good at generating backtraces as gcc is, although I should be able to get something...


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.


That's okay, I don't mind doing the detective work. The crash has all the hallmarks of something getting "double deleted" but when I placed a breakpoint in Gtk::Window::~Window() there was no evidence that it was getting called twice. Perhaps one of its components might be getting double deleted? The only other thing which strikes me as odd is this:-

        // From gtk/gtkmm/window.cc...
        Window::~Window()
        {
            destroy_(); // <--- Breakpoint #2 here
        }

        // From my testing code (not the full example)...
        int main (int argc, char *argv[])
        {
            Gtk::Window* pW = new Gtk::Window;
            delete pW; // <--- Breakpoint #1 here

            return 0;
        }

When my code stops at breakpoint #1 I make a note of the value of 'pW'. When it stops at breakpoint #2 I'd expect my 'this' pointer to have the same value - but it doesn't. It's always slightly different. For example, when pW == 0x03604fb0 at breakpoint #1, I notice that at breakpoint #2, 'this' == 0x03604fcc. I'm not familiar enough with gtkmm to know if that indicates a problem but there's a consistent difference between them. Does that seem sensible to you?

John


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