From 6ac84a6e53eff4a02d44232a44564f95347f031c Mon Sep 17 00:00:00 2001 From: Marc Rousavy Date: Fri, 19 Apr 2024 14:51:56 +0200 Subject: [PATCH] fix: Fix `makeImageFromHardwareBuffer` memory leak --- package/android/cpp/rnskia-android/SkiaOpenGLSurfaceFactory.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package/android/cpp/rnskia-android/SkiaOpenGLSurfaceFactory.cpp b/package/android/cpp/rnskia-android/SkiaOpenGLSurfaceFactory.cpp index 377a4e7520..3e1abb0c20 100644 --- a/package/android/cpp/rnskia-android/SkiaOpenGLSurfaceFactory.cpp +++ b/package/android/cpp/rnskia-android/SkiaOpenGLSurfaceFactory.cpp @@ -51,7 +51,7 @@ SkiaOpenGLSurfaceFactory::makeImageFromHardwareBuffer(void *buffer) { sk_sp image = SkImages::BorrowTextureFrom( ThreadContextHolder::ThreadSkiaOpenGLContext.directContext.get(), backendTex, kTopLeft_GrSurfaceOrigin, kRGBA_8888_SkColorType, - kOpaque_SkAlphaType, nullptr); + kOpaque_SkAlphaType, nullptr, deleteImageProc, deleteImageCtx); return image; #else throw std::runtime_error(