2013/7/31 Krzysztof Kosiński <tweenk.pl@...400...>:
Note that NRObject once contained a better solution to this problem, which automatically invoked the C++ constructor at instance init time. You can dig out nr-object.cpp and nr-object.h from source control and investigate. However, using it would require you to rewrite the init functions of all SPObjects.
Some additional details: NRObject had a virtual function in its class, called invoke_ctor, which was replaced in every derived object by something similar to you GMEMWRAP trick - a static function that was a member of template which simply called the constructor. The dispose function was handled in a similar way.
Replacing GObject-style initialization with constructor / destructor shims in the style of NRObject would considerably simplify removing the GObject dependency later and reduce the burden of maintaining the init / dispose functions.
Regards, Krzysztof