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/TestAllCodecs.cc b/webrtc/modules/audio_coding/main/test/TestAllCodecs.cc
index c47a582..d6c6dc4 100644
--- a/webrtc/modules/audio_coding/main/test/TestAllCodecs.cc
+++ b/webrtc/modules/audio_coding/main/test/TestAllCodecs.cc
@@ -100,8 +100,8 @@
 }
 
 TestAllCodecs::TestAllCodecs(int test_mode)
-    : acm_a_(NULL),
-      acm_b_(NULL),
+    : acm_a_(AudioCodingModule::Create(0)),
+      acm_b_(AudioCodingModule::Create(1)),
       channel_a_to_b_(NULL),
       test_count_(0),
       packet_size_samples_(0),
@@ -111,14 +111,6 @@
 }
 
 TestAllCodecs::~TestAllCodecs() {
-  if (acm_a_ != NULL) {
-    AudioCodingModule::Destroy(acm_a_);
-    acm_a_ = NULL;
-  }
-  if (acm_b_ != NULL) {
-    AudioCodingModule::Destroy(acm_b_);
-    acm_b_ = NULL;
-  }
   if (channel_a_to_b_ != NULL) {
     delete channel_a_to_b_;
     channel_a_to_b_ = NULL;
@@ -135,9 +127,6 @@
                  "---------- TestAllCodecs ----------");
   }
 
-  acm_a_ = AudioCodingModule::Create(0);
-  acm_b_ = AudioCodingModule::Create(1);
-
   acm_a_->InitializeReceiver();
   acm_b_->InitializeReceiver();
 
@@ -154,7 +143,7 @@
   // Create and connect the channel
   channel_a_to_b_ = new TestPack;
   acm_a_->RegisterTransportCallback(channel_a_to_b_);
-  channel_a_to_b_->RegisterReceiverACM(acm_b_);
+  channel_a_to_b_->RegisterReceiverACM(acm_b_.get());
 
   // All codecs are tested for all allowed sampling frequencies, rates and
   // packet sizes.
@@ -736,11 +725,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: {