From 9cbc63887304b61d07542457e357df776dad8482 Mon Sep 17 00:00:00 2001 From: Brian Fiete Date: Mon, 27 Dec 2021 14:02:51 -0500 Subject: [PATCH] Properly dispose of variant result --- BeefLibs/corlib/src/Reflection/AttributeInfo.bf | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/BeefLibs/corlib/src/Reflection/AttributeInfo.bf b/BeefLibs/corlib/src/Reflection/AttributeInfo.bf index 1e515ae9..0489904a 100644 --- a/BeefLibs/corlib/src/Reflection/AttributeInfo.bf +++ b/BeefLibs/corlib/src/Reflection/AttributeInfo.bf @@ -105,7 +105,8 @@ namespace System.Reflection argIdx++; } - methodInfo.Invoke(targetAttr, params args); + if (methodInfo.Invoke(targetAttr, params args) case .Ok(var val)) + val.Dispose(); return .Ok; }