Ignore:
Timestamp:
Dec 22, 2010, 3:52:27 PM (13 years ago)
Author:
garnier
Message:

geant4 tag 9.4

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/persistency/gdml/src/G4GDMLRead.cc

    r1337 r1347  
    2424// ********************************************************************
    2525//
    26 // $Id: G4GDMLRead.cc,v 1.47 2009/05/12 15:46:43 gcosmo Exp $
    27 // GEANT4 tag $Name: geant4-09-04-beta-01 $
     26// $Id: G4GDMLRead.cc,v 1.50 2010/11/17 10:47:02 gcosmo Exp $
     27// GEANT4 tag $Name: gdml-V09-03-09 $
    2828//
    2929// class G4GDMLRead Implementation
     
    199199      const xercesc::DOMAttr* const attribute
    200200            = dynamic_cast<xercesc::DOMAttr*>(attribute_node);   
     201      if (!attribute)
     202      {
     203        G4Exception("G4GDMLRead::LoopRead()", "InvalidRead",
     204                    FatalException, "No attribute found!");
     205        return;
     206      }
    201207      const G4String attribute_name = Transcode(attribute->getName());
    202208      const G4String attribute_value = Transcode(attribute->getValue());
     
    266272void G4GDMLRead::Read(const G4String& fileName,
    267273                            G4bool validation,
    268                             G4bool isModule)
     274                            G4bool isModule,
     275                            G4bool strip)
    269276{
    270277   if (isModule)
     
    305312     G4Exception("G4GDMLRead::Read()", "InvalidRead",
    306313                 FatalException, error_msg);
     314     return;
    307315   }
    308316   xercesc::DOMElement* element = doc->getDocumentElement();
     
    312320     G4Exception("G4GDMLRead::Read()", "InvalidRead",
    313321                 FatalException, "Empty document!");
     322     return;
    314323   }
    315324
     
    321330      const xercesc::DOMElement* const child
    322331            = dynamic_cast<xercesc::DOMElement*>(iter);
     332      if (!child)
     333      {
     334        G4Exception("G4GDMLRead::Read()", "InvalidRead",
     335                    FatalException, "No child found!");
     336        return;
     337      }
    323338      const G4String tag = Transcode(child->getTagName());
    324339
     
    337352   }
    338353
    339    if (parser)  { delete parser;  }
    340    if (handler) { delete handler; }
     354   delete parser;
     355   delete handler;
    341356
    342357   if (isModule)
     
    347362   {
    348363      G4cout << "G4GDML: Reading '" << fileName << "' done!" << G4endl;
    349       StripNames();
    350    }
    351 }
     364      if (strip)  { StripNames(); }
     365   }
     366}
Note: See TracChangeset for help on using the changeset viewer.