fixup! Enable resource manager commonization 38/316338/1
authorSangchul Lee <sc11.lee@samsung.com>
Mon, 19 Aug 2024 22:49:51 +0000 (07:49 +0900)
committerSangchul Lee <sc11.lee@samsung.com>
Mon, 19 Aug 2024 22:52:35 +0000 (07:52 +0900)
Even if it does not need to register resource handle according to
the webrtc configuration, it must not emit the error in the state
of release.

Change-Id: I82798b7f84850f13d5d8b824fab517ed100e324a
Signed-off-by: Sangchul Lee <sc11.lee@samsung.com>
src/webrtc_resource.c

index ca2e085976c9c97b76507150fe7ab665ee2010fb..e54a71f44ecd32c7ce0a441782d6c9c0f2aa30b9 100644 (file)
@@ -221,7 +221,9 @@ int _release_resource(webrtc_s *webrtc, res_type_e type)
        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);
 
@@ -264,7 +266,9 @@ int _unregister_resource_manager(webrtc_s *webrtc)
        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) {