]> git.sesse.net Git - nageru/commitdiff
Fix some leaks on DecklinkCapture shutdown.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 2 May 2016 23:44:49 +0000 (01:44 +0200)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 2 May 2016 23:44:49 +0000 (01:44 +0200)
decklink_capture.cpp
decklink_capture.h

index 956c546e6f93a9b8d823e1e7475917466befb83f..a4753cbd767eefc8a480242a64775cedf95c3141 100644 (file)
@@ -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 *)
index 69ab08e3cd48285e399c4a57d0bf5af932060003..f54711674b73757851f14c20c3e5f00fcff8f057 100644 (file)
@@ -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 <card>.
        ~DeckLinkCapture();
 
        // IDeckLinkInputCallback.
@@ -106,6 +106,7 @@ private:
 
        IDeckLinkConfiguration *config = nullptr;
 
+       IDeckLink *card = nullptr;
        IDeckLinkInput *input = nullptr;
        BMDTimeValue frame_duration;
        BMDTimeScale time_scale;