OpenDCL Forums

OpenDCL => Source Code => Topic started by: Danielm103 on September 03, 2009, 04:11:15 PM

Title: Bricscad and resbufs
Post by: Danielm103 on September 03, 2009, 04:11:15 PM

Hi Owen
something you might want to be aware of. Bricscad does not automatically free the resbuf returned by acedGetArgs as AutoCAD does, you must explicitly call acutRelRb. I have filed a bug report with Bricsys regarding this, but I don't think it has been fixed yet.
calling acutRelRb and setting the pointer to NULL seems to make both platforms happy.
Title: Re: Bricscad and resbufs
Post by: owenwengerd on September 03, 2009, 06:22:38 PM
Thanks for the heads up. Since acutRelRb() on the returned list is a no-op in AutoCAD, an easy solution would be to call acutRelRb on both platforms (except that for OpenDCL that would mean adding acutRelRb in 446 places). I just did a quick test, and the more serious problem is that in Bricscad every call to acedGetArgs returns a new copy of the argument resbuf. This causes the OpenDCL argument processing algorithm to fail because it calls acedGetArgs a second time to get back to the head of the list for calculating which argument triggered the argument processing exception. All this because Autodesk forgot to type the returned resbuf* as const in the R13 header file.

Hopefully Bricsys fixes their implementation to match AutoCAD's, then I won't need to worry about it.