Example #1
0
        internal static void Dispose(object sender, EventArgs args)
        {
            Audio.Unload(); // This exists but never gets called by the vanilla game.

            if (_DetourModManager != null)
            {
                foreach (Assembly asm in _DetourOwners)
                {
                    _DetourModManager.Unload(asm);
                }

                _DetourModManager.Dispose();
                _DetourModManager = null;
                _DetourOwners.Clear();
            }
        }
        internal static void Dispose()
        {
            if (!Initialized)
            {
                return;
            }
            Initialized = false;

            Manager.Dispose();

            HookEndpointManager.OnGenerateCecilModule -= GenerateCecilModule;

            HookOnUnloadContent.Dispose();
            HookOnUnloadAll.Dispose();
            HookOnLogSilentException?.Dispose();
        }