Fix proxy memory leak.
am: 32c8bdc9fd -s ours
Change-Id: I02c734b480f3d1dccc1607b8f57cf0c1895e3054
diff --git a/base/include/hidl/Status.h b/base/include/hidl/Status.h
index 7c716c7..f812ebb 100644
--- a/base/include/hidl/Status.h
+++ b/base/include/hidl/Status.h
@@ -161,9 +161,17 @@
}
// Check if underlying error is DEAD_OBJECT.
- // Does not set mCheckedStatus.
+ // Check mCheckedStatus only if this method returns true.
bool isDeadObject() const {
- return mStatus.transactionError() == DEAD_OBJECT;
+ bool dead = mStatus.transactionError() == DEAD_OBJECT;
+
+ // This way, if you only check isDeadObject your process will
+ // only be killed for more serious unchecked errors
+ if (dead) {
+ mCheckedStatus = true;
+ }
+
+ return dead;
}
// For debugging purposes only
diff --git a/transport/memory/1.0/default/Android.bp b/transport/memory/1.0/default/Android.bp
index b0c601a..93f6370 100644
--- a/transport/memory/1.0/default/Android.bp
+++ b/transport/memory/1.0/default/Android.bp
@@ -23,12 +23,10 @@
"HidlFetch.cpp"
],
shared_libs: [
- "liblog",
"libcutils",
"libhardware",
"libhwbinder",
"libbase",
- "libcutils",
"libutils",
"libhidlbase",
"libhidltransport",