Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stop()でのポインタ配慮 #1

Merged
merged 2 commits into from
Mar 25, 2024
Merged

stop()でのポインタ配慮 #1

merged 2 commits into from
Mar 25, 2024

Conversation

asaday
Copy link
Contributor

@asaday asaday commented Mar 22, 2024

No description provided.

@koizuka
Copy link
Member

koizuka commented Mar 22, 2024

n-air-app/n-air-app#728

@@ -869,8 +871,8 @@ namespace {

obs_source_t* context_;

Microsoft::WRL::ComPtr<IMMDeviceCollection> pDeviceCollection_;
Microsoft::WRL::ComPtr<IMMDevice> pDevice_;
Microsoft::WRL::ComPtr<IMMDeviceCollection> pDeviceCollection_ = nullptr;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

デフォルトコンストラクタでは nullptr 初期化されるので冗長です。

pCaptureClient_.Reset();
pAudioClientIn_.Reset();
pDevice_.Reset();
if (pCaptureClient_) pCaptureClient_.Reset();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reset 内では nullptr チェックされるので冗長です。

@skitaoka
Copy link
Contributor

LGTM

@skitaoka skitaoka merged commit 91e5449 into n-air-app:main Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants