2013/8/28 Sebastian Götte <jaseg@...2974...>:
> Be careful with placement new onto GObjects allocated by g_object_new. g_object_new puts some GObject type info into the first few bytes of the struct which is trashed when placement new invokes the whole constructor hierarchy beginning at GObject (the C++ class) since this class' constructor can not preserve the type info field's memory content. You will not notice that in normal operation except when using dynamic GObject type casts (those CLASS_NAME(object) macros) which will throw warnings on the console, though not crash, or when using g_object_unref, since the reference counter is initialized with 1 but overwritten to 0. Also, at many points in Inkscape's code base there are asserts that will crash Inkscape when they encounter a GObject lacking type information.You should never call placement new on the GObject itself. But you
have to call it on its members.
------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Inkscape-devel mailing list
Inkscape-devel@...1794...s.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/inkscape-devel