diff options
author | Naomi Luis <nluis@codeaurora.org> | 2010-11-18 12:48:25 -0800 |
---|---|---|
committer | Naomi Luis <nluis@codeaurora.org> | 2010-11-22 14:03:18 -0800 |
commit | 637e3fd523f79e179973c6d683ddc816b6fa67ac (patch) | |
tree | 5fb597c5483e65d78170588a4783e36caaf92b53 | |
parent | e2ec61b23b6da2f6f0796939c3e00aa77bf17569 (diff) | |
download | base-637e3fd523f79e179973c6d683ddc816b6fa67ac.tar.gz |
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
-rw-r--r-- | libs/ui/Overlay.cpp | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/libs/ui/Overlay.cpp b/libs/ui/Overlay.cpp index 3aa8950af53b..b082c534a0fb 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 { |