From 6ac03a94da0872c424caab1de79a9a0c1822305a Mon Sep 17 00:00:00 2001 From: "Steinar H. Gunderson" Date: Tue, 3 May 2016 01:44:49 +0200 Subject: [PATCH] Fix some leaks on DecklinkCapture shutdown. --- decklink_capture.cpp | 5 ++++- decklink_capture.h | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/decklink_capture.cpp b/decklink_capture.cpp index 956c546..a4753cb 100644 --- a/decklink_capture.cpp +++ b/decklink_capture.cpp @@ -134,7 +134,7 @@ size_t memcpy_interleaved_fastpath(uint8_t *dest1, uint8_t *dest2, const uint8_t } // namespace DeckLinkCapture::DeckLinkCapture(IDeckLink *card, int card_index) - : card_index(card_index) + : card_index(card_index), card(card) { { const char *model_name; @@ -262,6 +262,9 @@ DeckLinkCapture::~DeckLinkCapture() if (has_dequeue_callbacks) { dequeue_cleanup_callback(); } + input->Release(); + config->Release(); + card->Release(); } HRESULT STDMETHODCALLTYPE DeckLinkCapture::QueryInterface(REFIID, LPVOID *) diff --git a/decklink_capture.h b/decklink_capture.h index 69ab08e..f547116 100644 --- a/decklink_capture.h +++ b/decklink_capture.h @@ -17,7 +17,7 @@ class IDeckLinkDisplayMode; class DeckLinkCapture : public CaptureInterface, IDeckLinkInputCallback { public: - DeckLinkCapture(IDeckLink *card, int card_index); + DeckLinkCapture(IDeckLink *card, int card_index); // Takes ownership of . ~DeckLinkCapture(); // IDeckLinkInputCallback. @@ -106,6 +106,7 @@ private: IDeckLinkConfiguration *config = nullptr; + IDeckLink *card = nullptr; IDeckLinkInput *input = nullptr; BMDTimeValue frame_duration; BMDTimeScale time_scale; -- 2.39.2