I have some code in which I use the RhinoIntersectBreps
call to intersect a surface with a planar surface. During debugging in the debug version of Rhino of the SDK, I sometimes get a DebugBreak. Just choosing continue does not give any problems like crashes. But: I do see that there are memory leaks that originate from this point.
The reason for this seems to be that the intersection between the two Breps is not very “nice”, for example intersection through co-planar parts, or an intersection that has edges of both Breps very close to each other.
I say this, because if I take care to avoid these not-so-nice cases, the DebugBreak does not occur and the memory leaks are not reported.
Anyway, first of all I wanted to report this behavior. Secondly, I do not seem to be able to do anything in code to handle the situation and prevent memory leaks. I have tried to catch std::exception
and CException
but that does not work (no exceptions seem to be thrown). Any suggestions on how to handle this are welcome.