[C++] Custom ON_Geometry not restored when opening document

Hello,

I am creating a plugin with a custom CRhinoObject which holds a custom ON_Geometry. I can create the object just fine and add it to the document. But when I try to save the document and open it again, my object is not recreated.
I override the Write and Read functions of the ON_Geometry, and I have verified that they are both called respectively when saving the document and opening it. However the geometry is destroyed after being read and no object is created.

Here’s a log of what happens:

// Creation of object
MyGeometry::ctor default
MyObject::ctor default
MyGeometry::GetBBox
// Saving document
MyGeometry::Write
// Closing document
MyObject::dtor
MyGeometry::dtor
// Opening document
CreateNewMyGeometry
MyGeometry::ctor default
MyGeometry::Read
MyGeometry::dtor

Could I have missed something on the initialization and/or writing? Everything works fine, except the object not being recreated when opening.

Thanks a lot