[gtkmm] Possible bug in 1.3.26



[rjhansen numbers gtkgpg-0.1]$ more bug.h
#include <gtkmm.h>

struct Bug : public Gtk::VBox {
public:
  Bug();
  virtual ~Bug() {};
  
protected:
  Gtk::Label _label;
  Gtk::Entry _entry;
  Gtk::HBox _hbox;
};

[rjhansen numbers gtkgpg-0.1]$ more bug.cc
#include "bug.h"

Bug::Bug() 
{
  _label.set_text("Recipients: ");
  _hbox.pack_start(_label, false);
  _hbox.pack_start(_entry, true, true);
  pack_start(_hbox, false);
}

int main(int argc, char *argv[])
{
  Gtk::Main mainloop(&argc, &argv);
  Gtk::Window window;
  Bug bug;
  window.add(bug);
  window.show_all();
  mainloop.run(window);
  return 0;
}


... When compiling the above code (Mandrake 9 box, GCC 3.2) with -Wall
-W, I get no complaints whatsoever.  When I execute the code, the widget
appears fine and dandy; but when I close the window, I get a segfault.

Replacing the Gtk::HBox with a Gtk::HBox* (either manually handled or
handed off to manage()) removes the problem.

Can anyone shed some light on what's going on here?


-- 




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