From 01f23e17fe846f7a2cb9b685fa4f6c8683b70260 Mon Sep 17 00:00:00 2001 From: Michael Fabian 'Xaymar' Dirks Date: Mon, 16 Dec 2019 23:07:49 +0100 Subject: [PATCH] gs-effect: Also override finalizer for the stored ptr --- source/obs/gs/gs-effect.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/obs/gs/gs-effect.cpp b/source/obs/gs/gs-effect.cpp index c6d0a52e..6120a7b0 100644 --- a/source/obs/gs/gs-effect.cpp +++ b/source/obs/gs/gs-effect.cpp @@ -66,7 +66,7 @@ gs::effect::effect(std::string code, std::string name) : std::runtime_error("Unknown error during effect compile."); } - reset(effect); + reset(effect, [](gs_effect_t* ptr) { gs_effect_destroy(ptr); }); } gs::effect::effect(std::filesystem::path file) : effect(load_file_as_code(file), file.string()) {} @@ -74,7 +74,7 @@ gs::effect::effect(std::filesystem::path file) : effect(load_file_as_code(file), gs::effect::~effect() { auto gctx = gs::context(); - gs_effect_destroy(get()); + reset(); } size_t gs::effect::count_techniques()