Skip to content

Commit 637e3fd

Browse files
author
Naomi Luis
committed
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
1 parent e2ec61b commit 637e3fd

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

libs/ui/Overlay.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,22 @@ void* Overlay::getBufferAddress(overlay_buffer_t buffer)
9696
}
9797

9898
void Overlay::destroy() {
99-
if (mStatus != NO_ERROR) return;
10099

101100
// Must delete the objects in reverse creation order, thus the
102101
// data side must be closed first and then the destroy send to
103102
// the control side.
104103
if (mOverlayData) {
105104
overlay_data_close(mOverlayData);
106105
mOverlayData = NULL;
106+
} else {
107+
LOGD("Overlay::destroy mOverlayData is NULL");
107108
}
108109

109-
mOverlayRef->mOverlayChannel->destroy();
110+
if (mOverlayRef != 0) {
111+
mOverlayRef->mOverlayChannel->destroy();
112+
} else {
113+
LOGD("Overlay::destroy mOverlayRef is NULL");
114+
}
110115
}
111116

112117
status_t Overlay::getStatus() const {

0 commit comments

Comments
 (0)