Loading services/audioflinger/PlaybackTracks.h +4 −1 Original line number Diff line number Diff line Loading @@ -117,7 +117,10 @@ protected: enum {FS_INVALID, FS_FILLING, FS_FILLED, FS_ACTIVE}; mutable uint8_t mFillingUpStatus; int8_t mRetryCount; const sp<IMemory> mSharedBuffer; // see comment at AudioFlinger::PlaybackThread::Track::~Track for why this can't be const sp<IMemory> mSharedBuffer; bool mResetDone; const audio_stream_type_t mStreamType; int mName; // track name on the normal mixer, Loading services/audioflinger/Tracks.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -364,6 +364,16 @@ AudioFlinger::PlaybackThread::Track::Track( AudioFlinger::PlaybackThread::Track::~Track() { ALOGV("PlaybackThread::Track destructor"); // The destructor would clear mSharedBuffer, // but it will not push the decremented reference count, // leaving the client's IMemory dangling indefinitely. // This prevents that leak. if (mSharedBuffer != 0) { mSharedBuffer.clear(); // flush the binder command buffer IPCThreadState::self()->flushCommands(); } } void AudioFlinger::PlaybackThread::Track::destroy() Loading Loading
services/audioflinger/PlaybackTracks.h +4 −1 Original line number Diff line number Diff line Loading @@ -117,7 +117,10 @@ protected: enum {FS_INVALID, FS_FILLING, FS_FILLED, FS_ACTIVE}; mutable uint8_t mFillingUpStatus; int8_t mRetryCount; const sp<IMemory> mSharedBuffer; // see comment at AudioFlinger::PlaybackThread::Track::~Track for why this can't be const sp<IMemory> mSharedBuffer; bool mResetDone; const audio_stream_type_t mStreamType; int mName; // track name on the normal mixer, Loading
services/audioflinger/Tracks.cpp +10 −0 Original line number Diff line number Diff line Loading @@ -364,6 +364,16 @@ AudioFlinger::PlaybackThread::Track::Track( AudioFlinger::PlaybackThread::Track::~Track() { ALOGV("PlaybackThread::Track destructor"); // The destructor would clear mSharedBuffer, // but it will not push the decremented reference count, // leaving the client's IMemory dangling indefinitely. // This prevents that leak. if (mSharedBuffer != 0) { mSharedBuffer.clear(); // flush the binder command buffer IPCThreadState::self()->flushCommands(); } } void AudioFlinger::PlaybackThread::Track::destroy() Loading