[Issue 101] Solves memory leak on Windows

git-svn-id: http://webrtc.googlecode.com/svn/trunk@784 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/src/modules/audio_device/main/source/win/audio_device_core_win.cc b/src/modules/audio_device/main/source/win/audio_device_core_win.cc
index 4a28252..7395441 100644
--- a/src/modules/audio_device/main/source/win/audio_device_core_win.cc
+++ b/src/modules/audio_device/main/source/win/audio_device_core_win.cc
@@ -392,7 +392,6 @@
     _ptrCaptureClient(NULL),
     _ptrCaptureVolume(NULL),
     _ptrRenderSimpleVolume(NULL),
-    _ptrRenderEndpointVolume(NULL),
     _builtInAecEnabled(false),
     _playAudioFrameSize(0),
     _playSampleRate(0),
@@ -724,7 +723,6 @@
     SAFE_RELEASE(_ptrCaptureClient);
     SAFE_RELEASE(_ptrCaptureVolume);
     SAFE_RELEASE(_ptrRenderSimpleVolume);
-    SAFE_RELEASE(_ptrRenderEndpointVolume);
 
     return 0;
 }
@@ -812,19 +810,6 @@
         return -1;
     }
 
-    ret = _ptrDeviceOut->Activate(
-              __uuidof(IAudioEndpointVolume),
-              CLSCTX_ALL,
-              NULL,
-              reinterpret_cast<void **>(&_ptrRenderEndpointVolume));
-    if (ret != 0 || _ptrRenderEndpointVolume == NULL)
-    {
-        WEBRTC_TRACE(kTraceError, kTraceAudioDevice, _id,
-                    "  failed to initialize the render endpoint volume");
-        SAFE_RELEASE(_ptrRenderEndpointVolume);
-        return -1;
-    }
-
     IAudioSessionManager* pManager = NULL;
     ret = _ptrDeviceOut->Activate(__uuidof(IAudioSessionManager),
                                   CLSCTX_ALL,
@@ -838,6 +823,7 @@
         return -1;
     }
 
+    SAFE_RELEASE(_ptrRenderSimpleVolume);
     ret = pManager->GetSimpleAudioVolume(NULL, FALSE, &_ptrRenderSimpleVolume);
     if (ret != 0 || _ptrRenderSimpleVolume == NULL)
     {
@@ -849,7 +835,6 @@
     }
     SAFE_RELEASE(pManager);
 
-
     _speakerIsInitialized = true;
 
     return 0;
diff --git a/src/modules/audio_device/main/source/win/audio_device_core_win.h b/src/modules/audio_device/main/source/win/audio_device_core_win.h
index 9ea122c..94a8172 100644
--- a/src/modules/audio_device/main/source/win/audio_device_core_win.h
+++ b/src/modules/audio_device/main/source/win/audio_device_core_win.h
@@ -254,7 +254,6 @@
     IAudioCaptureClient*                    _ptrCaptureClient;
     IAudioEndpointVolume*                   _ptrCaptureVolume;
     ISimpleAudioVolume*                     _ptrRenderSimpleVolume;
-    IAudioEndpointVolume*                   _ptrRenderEndpointVolume;
 
     // DirectX Media Object (DMO) for the built-in AEC.
     scoped_refptr<IMediaObject>             _dmo;