Hi, I've a class that inherits from Gtk::PageSetup. Problem is whenever I call any method in my destructor, I get a segmentation fault. Attached a simple test case "p.cc" $ g++ -o p p.cc `pkg-config gtkmm-2.4 --cflags --libs` $ ./p Constructor Destructor Segmentation fault $ I'm using Debian testing gtkmm: 2.12.1-1 g++: 4.2.1-6 Any idea what am I doing wrongly ? Cheers, -- GPG-Key: 0xA3FD0DF7 - 9F73 032E EAC9 F7AD 951F 280E CB66 8E29 A3FD 0DF7 Debian User and Developer. Homepage: www.foolab.org
#include <iostream> #include <gtkmm.h> class PageSetup : public Gtk::PageSetup { public: static Glib::RefPtr<PageSetup> create() { return Glib::RefPtr<PageSetup>(new PageSetup()); } private: PageSetup() { std::cout << "Constructor" << std::endl; } ~PageSetup() { std::cout << "Destructor" << std::endl; std::cout << "Page Orientation " << get_orientation() << std::endl; } }; int main(int argc, char *argv[]) { Gtk::Main kit(argc, argv); Gtk::Window w; Glib::RefPtr<PageSetup> s = PageSetup::create(); kit.run(w); return 0; }
Attachment:
signature.asc
Description: Digital signature