rm_device_request_s requested;
mmf_camcorder_t *hcamcorder = MMF_CAMCORDER(handle);
+ rm_device_return_s *r_devices;
if (!hcamcorder->rm_handle) {
_mmcam_dbg_err("Resource is not initialized ");
return MM_ERROR_RESOURCE_NOT_INITIALIZED;
}
- if (hcamcorder->returned_devices.allocated_num > 0) {
+ r_devices = &hcamcorder->returned_devices;
+
+ if (r_devices->allocated_num > 0) {
memset(&requested, 0x0, sizeof(rm_device_request_s));
- requested.request_num = hcamcorder->returned_devices.allocated_num;
+ requested.request_num = r_devices->allocated_num;
for (idx = 0; idx < requested.request_num; idx++)
- requested.device_id[idx] = hcamcorder->returned_devices.device_id[idx];
+ requested.device_id[idx] = r_devices->device_id[idx];
rm_ret = rm_deallocate_resources(hcamcorder->rm_handle, &requested);
if (rm_ret != RM_OK)
_mmcam_dbg_err("Resource deallocation request failed ");
}
+ for (idx = 0; idx < r_devices->allocated_num; idx++) {
+ if (r_devices->device_node[idx]) {
+ free(r_devices->device_node[idx]);
+ r_devices->device_node[idx] = NULL;
+ }
+ if (r_devices->omx_comp_name[idx]) {
+ free(r_devices->omx_comp_name[idx]);
+ r_devices->omx_comp_name[idx] = NULL;
+ }
+ }
+
return MM_ERROR_NONE;
}