OSDN Git Service

Pull in scope of effectChains
authorGlenn Kasten <gkasten@google.com>
Tue, 13 Aug 2013 22:43:49 +0000 (15:43 -0700)
committerGlenn Kasten <gkasten@google.com>
Thu, 15 Aug 2013 00:18:57 +0000 (17:18 -0700)
Change-Id: Id5336f8663099088a0958fb8bd59fc5df9f92829

services/audioflinger/Threads.cpp

index 387ed4e..49520a1 100644 (file)
@@ -4195,7 +4195,6 @@ bool AudioFlinger::RecordThread::threadLoop()
 {
     AudioBufferProvider::Buffer buffer;
     sp<RecordTrack> activeTrack;
-    Vector< sp<EffectChain> > effectChains;
 
     nsecs_t lastWarning = 0;
 
@@ -4213,6 +4212,7 @@ bool AudioFlinger::RecordThread::threadLoop()
 
         processConfigEvents();
 
+        Vector< sp<EffectChain> > effectChains;
         { // scope for mLock
             Mutex::Autolock _l(mLock);
             checkForNewParameters_l();
@@ -4420,7 +4420,7 @@ bool AudioFlinger::RecordThread::threadLoop()
         }
         // enable changes in effect chain
         unlockEffectChains(effectChains);
-        effectChains.clear();
+        // effectChains doesn't need to be cleared, since it is cleared by destructor at scope end
     }
 
     standby();