Paste (me; into : mutable Attribute from TDF;
RT : mutable RelocationTable from TDF);
+ Destroy (me: mutable) is virtual;
+ ---C++ : alias ~
+ ---Purpose: Unregisters the document holding this attribute from an
+ -- internal global map of XDE documents.
+
end DocumentTool;
{
return RootLDocLMap.IsBound(D->Main().Root());
}
+
+
+//=======================================================================
+//function : Destroy
+//purpose : Removal of the document from RootLDocLMap is necessary. Otherwise
+// there remains orphan labels and upon creation of a new
+// label with XCAFDoc_DocumentTool attribute that
+// orphan is attempted to get used (when hashes match) causing
+// an exception when trying to access its data framework.
+//=======================================================================
+
+void XCAFDoc_DocumentTool::Destroy()
+{
+ TDF_Label DocL = Label();
+ if ( ! DocL.IsNull() ) {
+ TDF_Label RootL = DocL.Root();
+ if ( RootLDocLMap.IsBound( RootL ) )
+ RootLDocLMap.UnBind( RootL );
+ }
+}