[gtkmm] weird segfault

Hello all,

I have this code,

int main(int argc, char *argv[])
  Gtk::Main kit(argc, argv);
  Gtk::Window window;

  Glib::RefPtr<Gdk::Display> refDisplay = Gdk::Display::get_default();
  GdkDisplay *pGdkDisplay = refDisplay->gobj();

  return 0;

but it segfauls; here is the backtrace:

Program received signal SIGSEGV, Segmentation fault.
0x405b4a70 in _gdk_windowing_set_default_display () from
(gdb) bt
#0  0x405b4a70 in _gdk_windowing_set_default_display () from
#1  0x4059d307 in gdk_display_manager_set_default_display () from
#2  0x40595892 in gdk_display_dispose () from /usr/lib/libgdk-x11-2.0.so.0
#3  0x405b480d in gdk_display_x11_dispose () from
#4  0x40688bdd in g_object_last_unref () from /usr/lib/libgobject-2.0.so.0
#5  0x4055d8c2 in Glib::ObjectBase::unreference() const () from
#6  0x080496e0 in ~RefPtr (this=0xbffff980) at
#7  0x080495a8 in main (argc=1, argv=0xbffffa34) at wininfo.cpp:114
#8  0x40830e34 in __libc_start_main () from /lib/libc.so.6

note: line #6 is the destructor of RefPtr.

i'm doing something wrong?

Rui Lopes

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