Bricscad and resbufs

Started by Danielm103, September 03, 2009, 04:11:15 PM

Previous topic - Next topic


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.
Copyright© 2007 Daniel Marcotte, This posting is provided “AS IS” with no warranties and confers no rights


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.