Re: [gtk-list] Didn't Read the Instructions ..C++ and GTK+ ?



> Folks:
> 
> I created an elaborate application using GTK+ and C++.  I have been
> using g++ to compile.  I passed the main() arguments argc, and argv[] to
> my gApplication object via pointers.  Now, I am core dumping in the very
> exit of the program.  Each C++ object is being "deleted" and some are
> just going into their destructor methods just fine.  Anyhow, at the last
> return 0; in main(), ddd is telling me that I can't find the bounds of
> this function (which is main()).

Couldn't really say what level it came from without a back trace 
to tell what was on the stack at the time.

 
> Now that I have spent all of this time and effort without looking at
> GTK--, can anyone explain to me why I am having a scope problem I
> think?  The last object to be deleted is the gApplication object.  My
> gCmdAssistant, gOptionHelper, gFileAssistant,etc. objects all destruct
> just fine.  The problem I believe, is in the GTK Application scope
> itself, and its relation to Main().

Do you do any signal connects to C++ objects with the gtk+ signal
mechanism?  Since C++ objects don't clean up their signal connections
you may get a signal to any of the other objects that had already been
deleted which results in an invalid this pointer.  This is one of the key
reasons to use gtk-- as it solves these types of C++ issues.

> Any help would be appreciated.  Also, I can't seem to get a connection
> to the GTK-- link on www.gtk.org.

The site should be http://lazy.ton.tut.fi.  If you can't get that
just check out the gtk-- module from cvs.  The web page is under
experimental/web.  But more importantly there is an examples
directory and a good part of a tutorial.

Hope it helps.

--Karl



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