Community
I new a AcDbEntity. If I don't add it to database, which one should be used before function returns?
Thanks in advance.
After you successfully add an entity to a database, the database takes over ownership. While the database owns an object you must not destroy it, and use open/close to access it.
And, if you don't add the new entity to a database and you also don't retain a pointer to the entity after your function returns, then you've leaked the memory that the entity is using because you have no way to delete that entity.