Refactored the Vulkan::CommandPool class
[platform/core/uifw/dali-core.git] / dali / graphics / vulkan / vulkan-image.cpp
index ac1b9f6..3418797 100644 (file)
@@ -123,8 +123,12 @@ bool Image::OnDestroy()
   {
     mGraphics->RemoveImage(*this);
 
-    mGraphics->DiscardResource([this]() {
-      mGraphics->GetDevice().destroyImage(mImage, mGraphics->GetAllocator());
+    auto device = mGraphics->GetDevice();
+    auto image = mImage;
+    auto allocator = &mGraphics->GetAllocator();
+
+    mGraphics->DiscardResource([device, image, allocator]() {
+      device.destroyImage(image, allocator);
     });
   }