From: Steinar H. Gunderson Date: Mon, 2 May 2016 23:44:49 +0000 (+0200) Subject: Fix some leaks on DecklinkCapture shutdown. X-Git-Tag: 1.3.0~33 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=6ac03a94da0872c424caab1de79a9a0c1822305a;p=nageru Fix some leaks on DecklinkCapture shutdown. --- 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;