Fix memory leak of CommandBuffer 59/268459/2
authorHeeyong Song <heeyong.song@samsung.com>
Thu, 23 Dec 2021 05:35:59 +0000 (14:35 +0900)
committerHeeyong Song <heeyong.song@samsung.com>
Mon, 24 Jan 2022 06:10:43 +0000 (06:10 +0000)
Change-Id: I59534fd284063a05af6ecebc7d5fa34de083cd4b

dali/internal/graphics/gles-impl/egl-graphics-controller.cpp

index bee69ec..3667844 100644 (file)
@@ -105,7 +105,15 @@ const uint32_t TEXTURE_UPLOAD_MAX_BUFER_SIZE_MB = 1;
 
 } // namespace
 
-EglGraphicsController::~EglGraphicsController() = default;
+EglGraphicsController::~EglGraphicsController()
+{
+  while(!mPresentationCommandBuffers.empty())
+  {
+    auto presentCommandBuffer = const_cast<GLES::CommandBuffer*>(mPresentationCommandBuffers.front());
+    delete presentCommandBuffer;
+    mPresentationCommandBuffers.pop();
+  }
+}
 
 void EglGraphicsController::InitializeGLES(Integration::GlAbstraction& glAbstraction)
 {