Deleting the contents of an AcDbVoidPtrArray used for creating hatch

By Xiaodong Liang

Issue
When I use the AcDbHatch::appendLoop function that takes an AcDbVoidPtrArray of AcGeCurve objects, AutoCAD terminates unexpectedly when the memory is erased. Do I need to delete the elements of the array?

Solution
The existing documentation does not explicitly mention that once the loop definition array is passed over to AutoCAD, it is then kept internally to store the loop information inside the hatch.

The contents of AcDbVoidPtrArray in this case, should NOT be deleted.


Comments

Leave a Reply

Discover more from Autodesk Developer Blog

Subscribe now to keep reading and get access to the full archive.

Continue reading