From fffaadefe1f0902249a8e01f8696fc2f176cf7f1 Mon Sep 17 00:00:00 2001 From: Martin Pulec Date: Thu, 21 Jul 2022 13:27:56 +0200 Subject: [PATCH] DeckLink cap.: further use RELEASE_IF_NOT_NULL --- src/video_capture/decklink.cpp | 16 +++------------- 1 file changed, 3 insertions(+), 13 deletions(-) diff --git a/src/video_capture/decklink.cpp b/src/video_capture/decklink.cpp index a478cb927..ad098a7dc 100644 --- a/src/video_capture/decklink.cpp +++ b/src/video_capture/decklink.cpp @@ -1431,19 +1431,9 @@ static void cleanup_common(struct vidcap_decklink_state *s) { for (int i = 0; i < s->devices_cnt; ++i) { RELEASE_IF_NOT_NULL(s->state[i].deckLinkConfiguration); RELEASE_IF_NOT_NULL(s->state[i].deckLinkAttributes); - - if(s->state[i].deckLinkInput != NULL) - { - s->state[i].deckLinkInput->Release(); - s->state[i].deckLinkInput = NULL; - } - - if(s->state[i].deckLink != NULL) - { - s->state[i].deckLink->Release(); - s->state[i].deckLink = NULL; - } - } + RELEASE_IF_NOT_NULL(s->state[i].deckLinkInput); + RELEASE_IF_NOT_NULL(s->state[i].deckLink); + } free(s->audio.data);