Hey guys,
I compiled gtkmm with GTKMM_ATKMM_ENABLED 1
Applied a simple fix, run an example gtkmm program and it works just fine!
Here is how classes inherit destructors in order: ( I marked important code with bold )
Glib::ObjectBase
class ObjectBase : virtual public sigc::trackable
{
protected:
virtual ~ObjectBase() noexcept = 0; // pure virtual dtor, any derived class dtor won't throw.
}
Glib::Object
class Object : virtual public ObjectBase
{
protected:
virtual ~Object() noexcept;
}
Glib::Interface
class Interface : virtual public Glib::ObjectBase
{
public:
virtual ~Interface() noexcept;
}
Atk::Implementor
class Implementor : public Glib::Interface
{
public:
virtual ~Implementor() noexcept; // I think this is bad, you'll see why ...
}
Gtk::Widget
class Widget : public Object, public Buildable
#ifdef GTKMM_ATKMM_ENABLED
,public Atk::Implementor
{
//...
}
Now let's see the implementation of Atk::~Implementor()
Implementor::~Implementor() noexcept { } // do you see why this is bad ?
Atk::~Implementor is defined but it can't call Glib::Object::~Object()
because Glib::Object::~Object() is declared protected
I have removed ~Implementor() destructor and let the compiler generate one.
recompiled atkmm and it now it works just fine!
Please give your opinion, did I do the right thing? I'm not 100% sure.