From 637e3fd523f79e179973c6d683ddc816b6fa67ac Mon Sep 17 00:00:00 2001 From: Naomi Luis Date: Thu, 18 Nov 2010 12:48:25 -0800 Subject: 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 --- libs/ui/Overlay.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'libs') 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 { -- cgit v1.1