Re: Creating custom GTK+ widget using C++ -- Ctor/Dtor not called

On 02/15/2012 11:35 PM, Agnel Kurian wrote:
contained object were not being called. I had assumed that merely
compiling as C++ would make it work... but now I realize it need not be
so when allocated via g_object_new.

Note that you can always call placement new in your gobject constructor and explicitly invoke the C++ destructor in the gobject destructor. That way, even when created via g_object_new, your class will be correctly constructed in the C++ sense. Google "placement new" for more details.

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