DiscussionsIssue archiveOCCT:Application Framework

Archived issue #0026517

XML document save in method XmlTObjDrivers_ObjectDriver::Paste access null pointer.

CommunityOCCT:Application Frameworkclosed1 public note

Search issues

Description

void XmlTObjDrivers_ObjectDriver::Paste
                         (const Handle(TDF_Attribute)& Source,
                          XmlObjMgt_Persistent& Target,
                          XmlObjMgt_SRelocationTable& /*RelocTable*/) const
{
  Handle(TObj_TObject) aTObj =
    Handle(TObj_TObject)::DownCast( Source );
  Handle(TObj_Object) anIObject = aTObj->Get();
  //BUG: anIObject is null.
  XmlObjMgt::SetExtendedString (Target, anIObject->DynamicType()->Name());
}

// Exception Frame as below:
TKXmlTObj.dll!XmlTObjDrivers_ObjectDriver::Paste(const Handle_TDF_Attribute & Source, XmlObjMgt_Persistent & Target, TColStd_IndexedMapOfTransient & __formal) Line 93 C++
     TKXmlL.dll!XmlMDF::WriteSubTree(const TDF_Label & theLabel, LDOM_Element & theElement, TColStd_IndexedMapOfTransient & theRelocTable, const Handle_XmlMDF_ADriverTable & theDrivers) Line 102 C++
     TKXmlL.dll!XmlMDF::WriteSubTree(const TDF_Label & theLabel, LDOM_Element & theElement, TColStd_IndexedMapOfTransient & theRelocTable, const Handle_XmlMDF_ADriverTable & theDrivers) Line 118 C++
     TKXmlL.dll!XmlMDF::WriteSubTree(const TDF_Label & theLabel, LDOM_Element & theElement, TColStd_IndexedMapOfTransient & theRelocTable, const Handle_XmlMDF_ADriverTable & theDrivers) Line 118 C++
     TKXmlL.dll!XmlMDF::WriteSubTree(const TDF_Label & theLabel, LDOM_Element & theElement, TColStd_IndexedMapOfTransient & theRelocTable, const Handle_XmlMDF_ADriverTable & theDrivers) Line 118 C++
     TKXmlL.dll!XmlMDF::WriteSubTree(const TDF_Label & theLabel, LDOM_Element & theElement, TColStd_IndexedMapOfTransient & theRelocTable, const Handle_XmlMDF_ADriverTable & theDrivers) Line 118 C++
     TKXmlL.dll!XmlMDF::WriteSubTree(const TDF_Label & theLabel, LDOM_Element & theElement, TColStd_IndexedMapOfTransient & theRelocTable, const Handle_XmlMDF_ADriverTable & theDrivers) Line 118 C++
     TKXmlL.dll!XmlMDF::WriteSubTree(const TDF_Label & theLabel, LDOM_Element & theElement, TColStd_IndexedMapOfTransient & theRelocTable, const Handle_XmlMDF_ADriverTable & theDrivers) Line 118 C++
     TKXmlL.dll!XmlMDF::WriteSubTree(const TDF_Label & theLabel, LDOM_Element & theElement, TColStd_IndexedMapOfTransient & theRelocTable, const Handle_XmlMDF_ADriverTable & theDrivers) Line 118 C++
     TKXmlL.dll!XmlMDF::FromTo(const Handle_TDF_Data & theData, LDOM_Element & theElement, TColStd_IndexedMapOfTransient & theRelocTable, const Handle_XmlMDF_ADriverTable & theDrivers) Line 61 C++
     TKXmlL.dll!XmlLDrivers_DocumentStorageDriver::MakeDocument(const Handle_CDM_Document & theTDoc, LDOM_Element & theElement) Line 356 C++
     TKXmlL.dll!XmlLDrivers_DocumentStorageDriver::WriteToDomDocument(const Handle_CDM_Document & theDocument, LDOM_Element & theElement, const TCollection_ExtendedString & theFileName) Line 294 C++
     TKXmlL.dll!XmlLDrivers_DocumentStorageDriver::Write(const Handle_CDM_Document & theDocument, const TCollection_ExtendedString & theFileName) Line 117 C++
     TKCDF.dll!CDF_StoreList::Store(Handle_CDM_MetaData & aMetaData, TCollection_ExtendedString & aStatusAssociatedText) Line 108 C++
     TKCDF.dll!CDF_Store::Realize() Line 175 C++
     TKLCAF.dll!TDocStd_Application::SaveAs(const Handle_TDocStd_Document & D, const TCollection_ExtendedString & path) Line 255 C++
     TKTObj.dll!TObj_Application::SaveDocument(const Handle_TDocStd_Document & theSourceDoc, const char * theTargetFile) Line 87 C++
     TKTObj.dll!TObj_Model::SaveAs(const char * theFile) Line 305 C++

Steps to reproduce

1. Create a model of TObj.
2. Save the file to disk as xml.
3. Change the Object class name from A to B.
4. Load the model saved in step 2.
5. Save the model again, the crash will reproduced.

Public activity

1 archived note

Participants are labeled by their role within this record.

01Commenter 1
Duplication of 26518.

Related records