decklink: Use ComPtr for variables
This makes sure Decklink variables are automatically released. Closes https://github.com/obsproject/obs-studio/pull/5508
This commit is contained in:
parent
3df2f3e069
commit
efce0f41d0
7 changed files with 19 additions and 44 deletions
|
|
@ -18,11 +18,7 @@ DeckLinkDeviceMode::DeckLinkDeviceMode(const std::string &name, long long id)
|
|||
{
|
||||
}
|
||||
|
||||
DeckLinkDeviceMode::~DeckLinkDeviceMode(void)
|
||||
{
|
||||
if (mode != nullptr)
|
||||
mode->Release();
|
||||
}
|
||||
DeckLinkDeviceMode::~DeckLinkDeviceMode(void) {}
|
||||
|
||||
BMDDisplayMode DeckLinkDeviceMode::GetDisplayMode(void) const
|
||||
{
|
||||
|
|
@ -82,11 +78,5 @@ bool DeckLinkDeviceMode::IsEqualFrameRate(int64_t num, int64_t den)
|
|||
|
||||
void DeckLinkDeviceMode::SetMode(IDeckLinkDisplayMode *mode_)
|
||||
{
|
||||
IDeckLinkDisplayMode *old = mode;
|
||||
if (old != nullptr)
|
||||
old->Release();
|
||||
|
||||
mode = mode_;
|
||||
if (mode != nullptr)
|
||||
mode->AddRef();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue