g_autoptr(GMutexLocker) locker = NULL;
RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
- RET_VAL_IF(webrtc->resource.handle == 0, WEBRTC_ERROR_RESOURCE_FAILED, "webrtc resource handle is NULL");
+
+ if (webrtc->resource.handle == 0)
+ return WEBRTC_ERROR_NONE;
locker = g_mutex_locker_new(&webrtc->resource.control_lock);
int ret;
RET_VAL_IF(webrtc == NULL, WEBRTC_ERROR_INVALID_PARAMETER, "webrtc is NULL");
- RET_VAL_IF(webrtc->resource.handle == 0, WEBRTC_ERROR_RESOURCE_FAILED, "webrtc resource handle is NULL");
+
+ if (webrtc->resource.handle == 0)
+ return WEBRTC_ERROR_NONE;
ret = rm_unregister(webrtc->resource.handle);
if (ret != RM_OK) {