Skip to content

Commit

Permalink
fix teeny leak
Browse files Browse the repository at this point in the history
  • Loading branch information
rdp committed Aug 18, 2012
1 parent 70cc97a commit 5c605ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion source_code/acam/acam.vcxproj.user
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<LocalDebuggerCommand>C:\Program Files (x86)\Adobe\Flash Media Live Encoder 3.1\FlashMediaLiveEncoder.exe</LocalDebuggerCommand>
<LocalDebuggerCommand>C:\Program Files (x86)\Adobe\Flash Media Live Encoder 3.2\FlashMediaLiveEncoder.exe</LocalDebuggerCommand>
<DebuggerFlavor>WindowsLocalDebugger</DebuggerFlavor>
<LocalDebuggerCommandArguments>
</LocalDebuggerCommandArguments>
Expand Down
6 changes: 4 additions & 2 deletions source_code/acam/loopback-capture.cpp
Expand Up @@ -71,7 +71,7 @@ int getHtzRate() {
assert(false);
}

WAVEFORMATEX *pwfx; // hope this doesn't leak...
WAVEFORMATEX *pwfx;
hr = pAudioClient->GetMixFormat(&pwfx);
if (FAILED(hr)) {
ShowOutput("IAudioClient::GetMixFormat failed: hr = 0x%08x\n", hr);
Expand All @@ -83,7 +83,9 @@ int getHtzRate() {
AvRevertMmThreadCharacteristics(hTask);
pAudioClient->Release();
m_pMMDevice->Release();
return pwfx->nSamplesPerSec;
int samples = pwfx->nSamplesPerSec;
CoTaskMemFree(pwfx);
return samples;

}

Expand Down

0 comments on commit 5c605ec

Please sign in to comment.