summaryrefslogtreecommitdiffstats
path: root/libs/gui/ConsumerBase.cpp
diff options
context:
space:
mode:
authorJamie Gennis <jgennis@google.com>2013-04-09 21:43:20 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-04-09 21:43:20 +0000
commit8758a3e3941bae9ef11948506950521c4682acf1 (patch)
tree5bfe3cc87b0be85aee96055feb93e2425f9557ac /libs/gui/ConsumerBase.cpp
parent1df59c93fea8bec21b8084c34aface086f1e0896 (diff)
parente6a0f5028b3ef81916e7fd58a64f76861bfa78e0 (diff)
downloadframeworks_native-8758a3e3941bae9ef11948506950521c4682acf1.zip
frameworks_native-8758a3e3941bae9ef11948506950521c4682acf1.tar.gz
frameworks_native-8758a3e3941bae9ef11948506950521c4682acf1.tar.bz2
Merge changes I82e361a6,I83694682 into jb-mr2-dev
* changes: libgui_test: increase the tolerance for a YUV test libgui: fix an EGLImage leak
Diffstat (limited to 'libs/gui/ConsumerBase.cpp')
-rw-r--r--libs/gui/ConsumerBase.cpp13
1 files changed, 12 insertions, 1 deletions
diff --git a/libs/gui/ConsumerBase.cpp b/libs/gui/ConsumerBase.cpp
index 8694d21..4937b17 100644
--- a/libs/gui/ConsumerBase.cpp
+++ b/libs/gui/ConsumerBase.cpp
@@ -76,7 +76,18 @@ ConsumerBase::ConsumerBase(const sp<BufferQueue>& bufferQueue) :
}
ConsumerBase::~ConsumerBase() {
- CB_LOGV("~ConsumerBase");
+ CB_LOGV("~ConsumerBase");
+ Mutex::Autolock lock(mMutex);
+
+ // Verify that abandon() has been called before we get here. This should
+ // be done by ConsumerBase::onLastStrongRef(), but it's possible for a
+ // derived class to override that method and not call
+ // ConsumerBase::onLastStrongRef().
+ LOG_ALWAYS_FATAL_IF(!mAbandoned, "[%s] ~ConsumerBase was called, but the "
+ "consumer is not abandoned!", mName.string());
+}
+
+void ConsumerBase::onLastStrongRef(const void* id) {
abandon();
}