summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorNaomi Luis <nluis@codeaurora.org>2010-11-18 12:48:25 -0800
committerSteve Kondik <shade@chemlab.org>2010-11-26 06:27:14 -0500
commitae4360f3f1ef8f6cb69a1e1588c857eece21f7a0 (patch)
treefb556f7ebf5656963572f97af941c52e5682eede /libs
parent13a2423b7ecf82b369031e9b88c89bea6e7096d7 (diff)
downloadframeworks_base-ae4360f3f1ef8f6cb69a1e1588c857eece21f7a0.zip
frameworks_base-ae4360f3f1ef8f6cb69a1e1588c857eece21f7a0.tar.gz
frameworks_base-ae4360f3f1ef8f6cb69a1e1588c857eece21f7a0.tar.bz2
frameworks/base: Destroy the overlay even if there is an error
Allow the overlay object to be destroyed whenever the destroy is invoked. Currently the destroy call returns if there is an error encountered, which results in open data and control channels. Change-Id: I1f2ef4ebb5fb1dcabf05ab50b5bbf6e5e240a63a
Diffstat (limited to 'libs')
-rw-r--r--libs/ui/Overlay.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/libs/ui/Overlay.cpp b/libs/ui/Overlay.cpp
index 96f8006..34ec1b7 100644
--- a/libs/ui/Overlay.cpp
+++ b/libs/ui/Overlay.cpp
@@ -103,7 +103,6 @@ void* Overlay::getBufferAddress(overlay_buffer_t buffer)
}
void Overlay::destroy() {
- if (mStatus != NO_ERROR) return;
// Must delete the objects in reverse creation order, thus the
// data side must be closed first and then the destroy send to
@@ -111,9 +110,15 @@ void Overlay::destroy() {
if (mOverlayData) {
overlay_data_close(mOverlayData);
mOverlayData = NULL;
+ } else {
+ LOGD("Overlay::destroy mOverlayData is NULL");
}
- mOverlayRef->mOverlayChannel->destroy();
+ if (mOverlayRef != 0) {
+ mOverlayRef->mOverlayChannel->destroy();
+ } else {
+ LOGD("Overlay::destroy mOverlayRef is NULL");
+ }
}
status_t Overlay::getStatus() const {