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:
cg2121
2022-02-20 14:14:24 -06:00
committed by Jim
parent 3df2f3e069
commit efce0f41d0
7 changed files with 19 additions and 44 deletions

View File

@@ -16,8 +16,8 @@ struct obs_output_info decklink_output_info;
bool log_sdk_version()
{
IDeckLinkIterator *deckLinkIterator;
IDeckLinkAPIInformation *deckLinkAPIInformation;
ComPtr<IDeckLinkIterator> deckLinkIterator;
ComPtr<IDeckLinkAPIInformation> deckLinkAPIInformation;
HRESULT result;
deckLinkIterator = CreateDeckLinkIteratorInstance();
@@ -42,8 +42,6 @@ bool log_sdk_version()
blog(LOG_INFO, "Decklink API Installed version %s",
versionString.c_str());
deckLinkAPIInformation->Release();
}
return true;