Skip to content

Instantly share code, notes, and snippets.

@psyke83
Created August 24, 2014 21:45
Show Gist options
  • Select an option

  • Save psyke83/29aeaa0356004adbf8fb to your computer and use it in GitHub Desktop.

Select an option

Save psyke83/29aeaa0356004adbf8fb to your computer and use it in GitHub Desktop.
dlclose bug
extern "C" int close_camera_device(hw_device_t* hw_dev)
{
int rc = -1;
ALOGD("%s:++",__FUNCTION__);
camera_device_t *device = (camera_device_t *)hw_dev;
if (device) {
if (qCamera != NULL)
qCamera.clear();
free(device);
rc = 0;
}
#if DLOPEN_LIBCAMERA
if (libcameraHandle) {
::dlclose(libcameraHandle);
ALOGE("void *libcameraHandle= %p\n", libcameraHandle);
libcameraHandle = NULL;
}
#endif
ALOGD("%s:--",__FUNCTION__);
return rc;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment