Re: Crashing with widgets as class members



On Fri, 2006-02-10 at 17:32 +0000, John C. Spray wrote:
> On Fri, 2006-02-10 at 11:31 -0600, Bob Caryl wrote:
> > My class containing widgets is created with "new" long after the start
> > of the program, after other classes using gtkmm have functioned
> > correctly (and Gtk::Main) has been called.
> > 
> > Am I doing something illegal when I do:
> > 
> > class MyClass {
> >     public:
> >     Gtk::ComboBoxText mycombo_;
> > }
> > As you can see above, you are NOT creating Gtk::ComboBoxText as a 
> > pointer.  You are instantiating it in your MyClass definition.  This 
> > means that instantiation is going to happen before you initialize the 
> > toolkit.
> 
> Even if I have:
> 
> Gtk::Main kit(argc, argv);
> MyClass * myclass = new MyClass();
> 
> ?
> 
> My attempts to write a testcase have not been successful (that is, the
> testcase works as it's meant to).

Then I recommend valgrind's memcheck.

-- 
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]