Displaying 1 result from an estimated 1 matches for "gedestroydevdesc".
2014 Sep 19
1
Pointer ownership with GECreateDevDesc/GEDestroyDevDesc
...evDesc)))) return 0;
/* or error() */
/* set up device driver or free ?dev? and error() */
gdd = GEcreateDevDesc(dev); GEaddDevice2(gdd, "dev_name");
...elided...
which indicates to me that the calling code owns the pDevDesc structure and
should be responsible for freeing it.
However, in GEdestroyDevDesc, that particular code calls free(dd->dev),
freeing the pointer.
In my case, I have a device implemented and created in a language that is
using a different allocator. The pDevDesc I pass in is not owned by R and
causes a crash on free with "dev.off()".
I thought I could mitigate the...