Skip to content

Commit f0f6c54

Browse files
Jean-Baptiste QueruAndroid Code Review
authored andcommitted
Merge "frameworks/base: Destroy the overlay even if there is an error"
2 parents 4da48ec + 637e3fd commit f0f6c54

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)