drm_hwcomposer: Deinit HwcDisplay on destruction

When destroying IComposer3 while resouce manager deinits all of the
displays, the primary display always remains connected as Android
requires having a primary display that is always present so a
placeholder one is used instead. On cleanup when the IComposer3 is
destructed, we should make sure to deinit all of the displays it holds
due as otherwise it will leak threads belong to the display running in
the background.

Change-Id: I7dfeea75517ea2f1071a0fa704eac642ebffc0c7
Signed-off-by: Normunds Rieksts <normunds.rieksts@arm.com>
Signed-off-by: Drew Davenport <ddavenport@google.com>
diff --git a/hwc2_device/HwcDisplay.cpp b/hwc2_device/HwcDisplay.cpp
index 30bf740..e8bd945 100644
--- a/hwc2_device/HwcDisplay.cpp
+++ b/hwc2_device/HwcDisplay.cpp
@@ -85,7 +85,9 @@
   color_transform_hint_ = HAL_COLOR_TRANSFORM_IDENTITY;
 }
 
-HwcDisplay::~HwcDisplay() = default;
+HwcDisplay::~HwcDisplay() {
+  Deinit();
+};
 
 void HwcDisplay::SetPipeline(std::shared_ptr<DrmDisplayPipeline> pipeline) {
   Deinit();