From 57747bf94e7510e427af81e5b27e691318ba1a37 Mon Sep 17 00:00:00 2001 From: falkTX Date: Sun, 23 Mar 2025 14:08:04 +0100 Subject: [PATCH] Add WebViewDestroy class for usage in std::shared_ptr/unique_ptr Signed-off-by: falkTX --- distrho/extra/WebViewImpl.hpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/distrho/extra/WebViewImpl.hpp b/distrho/extra/WebViewImpl.hpp index cd185913..75a3d27a 100644 --- a/distrho/extra/WebViewImpl.hpp +++ b/distrho/extra/WebViewImpl.hpp @@ -125,3 +125,12 @@ void webViewReload(WebViewHandle webview); void webViewResize(WebViewHandle webview, uint width, uint height, double scaleFactor); // -------------------------------------------------------------------------------------------------------------------- + +/** + Helper class for usage in std::shared_ptr and std::unique_ptr. +*/ +struct WebViewDestroy { + void operator()(WebViewHandle handle) { webViewDestroy(handle); } +}; + +// --------------------------------------------------------------------------------------------------------------------