ObjectARX

Reply
Valued Contributor
mbujak
Posts: 53
Registered: ‎07-07-2004
Message 1 of 3 (161 Views)

AcDbGripData GetGripPoints() confusion......

161 Views, 2 Replies
02-07-2012 08:46 AM

It states in the documentation:

 

"The caller is responsible for freeing the AcDbGripData objects whose pointers are in the grips array."

 

I am fine with this, but, to do this the array of grip data objects must be stored or cached somewhere in order to be cleaned up. How do you do this when the subGetGripPoints() function is 'const'? Surely a member variable on the custom entity won't suffice.

 

Any suggestions?

 

Thanks

 

Mike  

Distinguished Mentor
owenwengerd
Posts: 676
Registered: ‎08-06-2002
Message 2 of 3 (159 Views)

Re: AcDbGripData GetGripPoints() confusion......

02-07-2012 09:04 AM in reply to: mbujak

If the caller is responsible for the AcDbGripData objects, you can't safely cache pointers to their memory (because the caller will delete them, leaving you with pointers to freed memory).

--

Owen Wengerd

ManuSoft

 

--
Owen Wengerd
ManuSoft
Valued Contributor
mbujak
Posts: 53
Registered: ‎07-07-2004
Message 3 of 3 (156 Views)

Re: AcDbGripData GetGripPoints() confusion......

02-07-2012 09:19 AM in reply to: mbujak

Ok, so, in the case of subGetGripPoints(...) the caller would be the Autocad framework, so I don't need to worry about the AcDbGripData object pointers themselves... Just any appData structures that I may pass into them.

 

Thanks

 

Mike

Post to the Community

Have questions about Autodesk products? Ask the community.

New Post
Announcements
Are You Going To Be @ AU 2014? Feel free to drop by our AU topic post and share your plans, plug a class that you're teaching, or simply check out who else from the community might be in attendance. Ohh and don't forgot to stop by the Autodesk Help | Learn | Collaborate booths in the Exhibit Hall and meet our community team if you get a chance!