Make the destructor of AudioCodingModule public.

This allows the type to be used with a scoped_ptr. Remove all calls to
the deprecated Destroy() from tests.

R=turaj@webrtc.org

Review URL: https://webrtc-codereview.appspot.com/2200006

git-svn-id: http://webrtc.googlecode.com/svn/trunk@4731 4adac7df-926f-26a2-2b94-8c16560cd09d
diff --git a/webrtc/modules/audio_coding/main/test/TestStereo.cc b/webrtc/modules/audio_coding/main/test/TestStereo.cc
index 9a0bf9e..65c9983 100644
--- a/webrtc/modules/audio_coding/main/test/TestStereo.cc
+++ b/webrtc/modules/audio_coding/main/test/TestStereo.cc
@@ -109,8 +109,8 @@
 }
 
 TestStereo::TestStereo(int test_mode)
-    : acm_a_(NULL),
-      acm_b_(NULL),
+    : acm_a_(AudioCodingModule::Create(0)),
+      acm_b_(AudioCodingModule::Create(1)),
       channel_a2b_(NULL),
       test_cntr_(0),
       pack_size_samp_(0),
@@ -132,14 +132,6 @@
 }
 
 TestStereo::~TestStereo() {
-  if (acm_a_ != NULL) {
-    AudioCodingModule::Destroy(acm_a_);
-    acm_a_ = NULL;
-  }
-  if (acm_b_ != NULL) {
-    AudioCodingModule::Destroy(acm_b_);
-    acm_b_ = NULL;
-  }
   if (channel_a2b_ != NULL) {
     delete channel_a2b_;
     channel_a2b_ = NULL;
@@ -168,9 +160,7 @@
   in_file_mono_->ReadStereo(false);
 
   // Create and initialize two ACMs, one for each side of a one-to-one call.
-  acm_a_ = AudioCodingModule::Create(0);
-  acm_b_ = AudioCodingModule::Create(1);
-  ASSERT_TRUE((acm_a_ != NULL) && (acm_b_ != NULL));
+  ASSERT_TRUE((acm_a_.get() != NULL) && (acm_b_.get() != NULL));
   EXPECT_EQ(0, acm_a_->InitializeReceiver());
   EXPECT_EQ(0, acm_b_->InitializeReceiver());
 
@@ -197,7 +187,7 @@
   // Create and connect the channel.
   channel_a2b_ = new TestPackStereo;
   EXPECT_EQ(0, acm_a_->RegisterTransportCallback(channel_a2b_));
-  channel_a2b_->RegisterReceiverACM(acm_b_);
+  channel_a2b_->RegisterReceiverACM(acm_b_.get());
 
   // Start with setting VAD/DTX, before we know we will send stereo.
   // Continue with setting a stereo codec as send codec and verify that
@@ -786,11 +776,11 @@
   AudioCodingModule* my_acm = NULL;
   switch (side) {
     case 'A': {
-      my_acm = acm_a_;
+      my_acm = acm_a_.get();
       break;
     }
     case 'B': {
-      my_acm = acm_b_;
+      my_acm = acm_b_.get();
       break;
     }
     default: