Skip to content

Commit 9b2ec71

Browse files
committed
Fixed: memory leak, method: GetActiveDevices
1 parent 2d276fe commit 9b2ec71

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

Source/SystemMicControlLite/Private/SystemMicLiteManager.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,12 +159,12 @@ TMap<FString, FString> FSystemMicLiteManager::GetActiveDevices()
159159
return TMap<FString, FString>();
160160
}
161161

162-
TComPtr<IMMDevice> Device;
163-
TComPtr<IPropertyStore> PropertyStore;
164-
LPWSTR pwszID = nullptr;
165-
166162
for (UINT i = 0; i < CountActiveDevices; i++)
167163
{
164+
TComPtr<IMMDevice> Device;
165+
TComPtr<IPropertyStore> PropertyStore;
166+
LPWSTR pwszID = nullptr;
167+
168168
DevicesCollection->Item(i, &Device);
169169
Device->GetId(&pwszID);
170170
Device->OpenPropertyStore(STGM_READ, &PropertyStore);

0 commit comments

Comments
 (0)