Hello together,
My colleague has the following problem:
void foo(void) { ClipVectorPtr clipP = NULL; if (mdlClip_fromElement(clipP, elDescr, false, view) == SUCCESS) { if (mdlClip_isElemInside(&bOver, edP, clipP, view, true)){…} } mdlClip_free(&clipP); }
"mdlClip_fromElement" fills "ClipVectorPtr". But "mdlClip_isElemInside" needs "ClipVectorCP". Must there be some converting or only some typecasting?
And he miss "mdlClip_free", also it is referenced several times in the help-file.
Thank you very much!
Volker
ClipVectorPtr is a ref-counted pointer that holds a ClipVector, it will free itself when it goes out of scope/is no longer referenced. Code should be updated as follows:
void foo(void){ ClipVectorPtr clip; if (mdlClip_fromElement(clip, elDescr, false, view) == SUCCESS) { if (mdlClip_isElemInside(&bOver, edP, clip.get(), view, true)){…} }}
Answer Verified By: Volker Hüfner