summaryrefslogtreecommitdiffstats
path: root/libs
diff options
context:
space:
mode:
authorNaomi Luis <nluis@codeaurora.org>2010-11-18 12:48:25 -0800
committerNaomi Luis <nluis@codeaurora.org>2010-11-22 14:03:18 -0800
commit29a73ba845b846cd0bcb9112179f78a54aea94b2 (patch)
treeaf76bb4fba1cf6b52a5f65e2a7cf9cdf48121f45 /libs
parent1351c0e48869cf2b0f72cb133c2f74ca15f6ce04 (diff)
downloadframeworks_native-29a73ba845b846cd0bcb9112179f78a54aea94b2.zip
frameworks_native-29a73ba845b846cd0bcb9112179f78a54aea94b2.tar.gz
frameworks_native-29a73ba845b846cd0bcb9112179f78a54aea94b2.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 3aa8950..b082c53 100644
--- a/libs/ui/Overlay.cpp
+++ b/libs/ui/Overlay.cpp
@@ -96,7 +96,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
@@ -104,9 +103,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 {