summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorMathias Agopian <mathias@google.com>2011-02-28 12:50:04 -0800
committerAndroid (Google) Code Review <android-gerrit@google.com>2011-02-28 12:50:04 -0800
commit8c8cfec0eade40b94f8151eb2e8e438837f896a5 (patch)
treef2d7ede94a69b96e20b65c6b688d975509b42bd9 /libs
parent6c113a14caa8778055c8edfafc47af60fea7ac92 (diff)
parent32a55cf66e12e5e56d2e05b73c6bef453477c2bb (diff)
downloadframeworks_base-8c8cfec0eade40b94f8151eb2e8e438837f896a5.zip
frameworks_base-8c8cfec0eade40b94f8151eb2e8e438837f896a5.tar.gz
frameworks_base-8c8cfec0eade40b94f8151eb2e8e438837f896a5.tar.bz2
Merge "Fix sp<> conversion operator / constructor"
Diffstat (limited to 'libs')
-rw-r--r--libs/utils/RefBase.cpp34
1 files changed, 30 insertions, 4 deletions
diff --git a/libs/utils/RefBase.cpp b/libs/utils/RefBase.cpp
index 0fd404d..bb6c125 100644
--- a/libs/utils/RefBase.cpp
+++ b/libs/utils/RefBase.cpp
@@ -99,20 +99,38 @@ public:
#if DEBUG_REFS_FATAL_SANITY_CHECKS
LOG_ALWAYS_FATAL("Strong references remain!");
#else
- LOGE("Strong references remain!");
+ LOGE("Strong references remain:");
#endif
+ ref_entry* refs = mStrongRefs;
+ while (refs) {
+ char inc = refs->ref >= 0 ? '+' : '-';
+ LOGD("\t%c ID %p (ref %d):", inc, refs->id, refs->ref);
+#if DEBUG_REFS_CALLSTACK_ENABLED
+ refs->stack.dump();
+#endif;
+ refs = refs->next;
+ }
}
if (!mRetain && mWeakRefs != NULL) {
dumpStack = true;
#if DEBUG_REFS_FATAL_SANITY_CHECKS
- LOG_ALWAYS_FATAL("Weak references remain!");
+ LOG_ALWAYS_FATAL("Weak references remain:");
#else
LOGE("Weak references remain!");
#endif
+ ref_entry* refs = mWeakRefs;
+ while (refs) {
+ char inc = refs->ref >= 0 ? '+' : '-';
+ LOGD("\t%c ID %p (ref %d):", inc, refs->id, refs->ref);
+#if DEBUG_REFS_CALLSTACK_ENABLED
+ refs->stack.dump();
+#endif;
+ refs = refs->next;
+ }
}
-
if (dumpStack) {
+ LOGE("above errors at:");
CallStack stack;
stack.update();
stack.dump();
@@ -228,7 +246,8 @@ private:
if (mTrackEnabled) {
AutoMutex _l(mMutex);
- ref_entry* ref = *refs;
+ ref_entry* const head = *refs;
+ ref_entry* ref = head;
while (ref != NULL) {
if (ref->id == id) {
*refs = ref->next;
@@ -249,6 +268,13 @@ private:
"(weakref_type %p) that doesn't exist!",
id, mBase, this);
+ ref = head;
+ while (ref) {
+ char inc = ref->ref >= 0 ? '+' : '-';
+ LOGD("\t%c ID %p (ref %d):", inc, ref->id, ref->ref);
+ ref = ref->next;
+ }
+
CallStack stack;
stack.update();
stack.dump();