Re: Why this code doesn't work?
- From: codekiddy <codekiddy gmail com>
- To: Phil Wolff <adiabat centurylink net>
- Cc: Gtkmm List <gtkmm-list gnome org>
- Subject: Re: Why this code doesn't work?
- Date: Sat, 19 Dec 2015 21:06:02 +0100
I also have gtkmm 3.16.0 but pango version is 2.38.1
I also figured out there must some sort of forgotten reference count, after looking at stack trace layout destructor gets called twice (not sure), once by ~RefPtr::Layout and another time by Pango::Layout::~Layout
to make the code work I have done this, but I'm not sure how safe is this. but it works ^^ and no throw is made from Layout's destructor.
int main(int argc, char* argv[])
{
Glib::RefPtr<Gtk::Application> app = Gtk::Application::create( argc, argv, "gtkmm.exe" );
class TestClass :
public Gtk::Window
{
public:
TestClass()
{
layout = (create_pango_layout("blah"));
layout->reference();
}
Glib::RefPtr<Pango::Layout> layout;
};
TestClass* instance = new TestClass;
app->run(*instance);
delete instance;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]