audioflinger: Fix RefBase "exception" issue from FastThread
Dummy NBLog::Writer in FastThread must not be stored by value
because it's a RefBase descendant. Storing it by value causes
a diagnostic output from ~RefBase because no strong
references to it ever exist. In future this will cause a crash.
Test: verify there are no "RefBase: Explicit destruction" messages
in logcat
Change-Id: I95716ec8e29fdd9485ef64a3334cef49bf29bc96
diff --git a/services/audioflinger/FastThread.h b/services/audioflinger/FastThread.h
index 2a71414..bbb1d22 100644
--- a/services/audioflinger/FastThread.h
+++ b/services/audioflinger/FastThread.h
@@ -78,12 +78,13 @@
unsigned mColdGen; // last observed mColdGen
bool mIsWarm; // true means ready to mix,
// false means wait for warmup before mixing
- struct timespec mMeasuredWarmupTs; // how long did it take for warmup to complete
- uint32_t mWarmupCycles; // counter of number of loop cycles during warmup phase
- uint32_t mWarmupConsecutiveInRangeCycles; // number of consecutive cycles in range
- NBLog::Writer mDummyNBLogWriter;
- NBLog::Writer* mNBLogWriter; // always non-nullptr: real NBLog::Writer* or &mDummyNBLogWriter
- status_t mTimestampStatus;
+ struct timespec mMeasuredWarmupTs; // how long did it take for warmup to complete
+ uint32_t mWarmupCycles; // counter of number of loop cycles during warmup phase
+ uint32_t mWarmupConsecutiveInRangeCycles; // number of consecutive cycles in range
+ sp<NBLog::Writer> mDummyNBLogWriter;
+ NBLog::Writer* mNBLogWriter; // always non-nullptr: real NBLog::Writer* or
+ // mDummyNBLogWriter.get()
+ status_t mTimestampStatus;
FastThreadState::Command mCommand;
bool mAttemptedWrite;