Add API for setting resource destruction callback
[platform/core/uifw/dali-adaptor.git] / dali / internal / imaging / macos / native-image-source-impl-mac.cpp
index 3e3b33f..cc99b1b 100644 (file)
@@ -45,7 +45,8 @@ NativeImageSourceCocoa::NativeImageSourceCocoa(
   unsigned int                        height,
   Dali::NativeImageSource::ColorDepth depth,
   Any                                 nativeImageSource)
-: mImage(MakeRef<CGImageRef>(nullptr))
+: mImage(MakeRef<CGImageRef>(nullptr)),
+  mResourceDestructionCallback()
 {
   DALI_ASSERT_ALWAYS(Adaptor::IsAvailable());
   DALI_ASSERT_ALWAYS(nativeImageSource.Empty());
@@ -205,4 +206,9 @@ bool NativeImageSourceCocoa::ReleaseBuffer()
   return false;
 }
 
+void NativeImageSourceCocoa::SetResourceDestructionCallback(EventThreadCallback* callback)
+{
+  mResourceDestructionCallback = std::unique_ptr<EventThreadCallback>(callback);
+}
+
 } // namespace Dali::Internal::Adaptor