Message 1 of 3
Bug Related to AcDbMText That Causes AutoCAD Crash
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Following are the key points:
- Add a command CreatText in ObjectARX.
const ACHAR* pContent = L"AA";
void CreateText()
{
AcDbMText* pText = new AcDbMText();
AppendDb(pText);
auto id = pText->objectId();
pText->close();
pText = nullptr;
acdbOpenAcDbEntity((AcDbEntity*&)pText, id, AcDb::kForWrite);
pText->setContents(pContent);
pText->close();
pText = nullptr;
}
Acad::ErrorStatus AppendDb(AcDbEntity* pEntity, const std::wstring& sBlkRec = ACDB_MODEL_SPACE, AcDbDatabase* pDb = acdbCurDwg())
{
Acad::ErrorStatus es = eNotImplementedYet;
AcDbBlockTableRecordPointer pBlockTableRecord(sBlkRec.c_str(), pDb, AcDb::kForWrite);
if ((es = pBlockTableRecord.openStatus()) != Acad::eOk)
return es;
return pBlockTableRecord->appendAcDbEntity(pEntity);
}
- Execute the command.
- Undo .
- Attempt to close the drawing, choose not to save, then AutoCAD crashes.
This issue occurs both in AutoCAD 2018 and 2022.