Skip to content

Commit

Permalink
dwgReader::readDwgObjects() stop reading after 1st error
Browse files Browse the repository at this point in the history
  • Loading branch information
lordofbikes committed Jan 8, 2022
1 parent d397170 commit e23cc1c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/intern/dwgreader.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1167,19 +1167,19 @@ bool dwgReader::readDwgEntity(dwgBuffer *dbuf, objHandle& obj, DRW_Interface& in

bool dwgReader::readDwgObjects(DRW_Interface& intfa, dwgBuffer *dbuf){
bool ret = true;
bool ret2 = true;

duint32 i=0;
DRW_DBG("\nentities map total size= "); DRW_DBG(ObjectMap.size());
DRW_DBG("\nobjects map total size= "); DRW_DBG(objObjectMap.size());
auto itB=objObjectMap.begin();
auto itE=objObjectMap.end();
while (itB != itE){
ret2 = readDwgObject(dbuf, itB->second, intfa);
if (ret) {
// once readDwgObject() failed, just clear the ObjectMap
ret = readDwgObject(dbuf, itB->second, intfa);
}
objObjectMap.erase(itB);
itB=objObjectMap.begin();
if (ret)
ret = ret2;
}
if (DRW_DBGGL == DRW_dbg::Level::Debug) {
for (auto it=remainingMap.begin(); it != remainingMap.end(); ++it){
Expand Down

0 comments on commit e23cc1c

Please sign in to comment.