drm_hwcomposer: Free failed composition in QueueComposition
Rather than maintaining ownership of the composition in the
caller, free the DrmComposition in QueueComposition on failure.
Change-Id: Id70e98ae1a8eef400bc29460bfc5a89c4707d617
Signed-off-by: Sean Paul <seanpaul@chromium.org>
diff --git a/drmcompositor.cpp b/drmcompositor.cpp
index 4268ab5..9ade368 100644
--- a/drmcompositor.cpp
+++ b/drmcompositor.cpp
@@ -71,6 +71,7 @@
drm_composition->TakeDisplayComposition(display));
if (ret) {
ALOGE("Failed to queue composition for display %d", display);
+ delete composition;
return ret;
}
}