[gtkmm] Gdk::Screen::get_default() crashes



Hi,

there is simple test case that shows how application could be crashed after Gdk::Screen::get_default() function call.
Any comments?

Regards,
-andrew

#include <gtkmm/main.h>
#include <gtkmm/window.h>
#include <gtkmm/label.h>

class MyWin : public Gtk::Window
{
public:
   MyWin()
   {
       Gtk::Label* l = manage( new Gtk::Label( "Simple Test" ) );
       add( *l );

       show_all_children();
   }
   ~MyWin()
   {
   }
};

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

    {
	Glib::RefPtr<Gdk::Screen> sc = Gdk::Screen::get_default();

// uncomment this line to "cure" crash
//	sc->reference();
    }

    MyWin win;
    kit.run( win );

    return 0;
}


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