Why this code doesn't work?





Simple example:

#include <pangomm/layout.h>
#include <gtkmm/window.h>

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"));
}

Glib::RefPtr<Pango::Layout> layout;
};

TestClass instance;

return app->run(instance);
}

program builds and runs fine, but when closing the app down, it throws in Layout::~Layout() destructor. Access violation reading location.

Can you reproduce this?


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