We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent fa4448c commit 571fcb5Copy full SHA for 571fcb5
api/AltV.Net/Module.cs
@@ -2,6 +2,7 @@
2
using System.Collections.Generic;
3
using System.Linq;
4
using System.Reflection;
5
+using System.Runtime.InteropServices;
6
using AltV.Net.Elements.Args;
7
using AltV.Net.Elements.Entities;
8
using AltV.Net.Events;
@@ -810,8 +811,11 @@ public virtual void OnScriptLoaded(IScript script)
810
811
812
public void SetExport(string key, Function function)
813
{
814
+ if (function == null) return;
815
functionExports[key] = function;
- CSharpNativeResource.SetExport(key, MValue.Create(function.call));
816
+ MValue.Function callDelegate = function.call;
817
+ GCHandle.Alloc(callDelegate);
818
+ CSharpNativeResource.SetExport(key, MValue.Create(callDelegate));
819
}
820
821
0 commit comments