Beispiel #1
0
        public virtual void Dispose()
        {
            foreach (var h in CallbackHandles)
            {
                h.Dispose();
            }
            CallbackHandles.Clear();

            if (Workshop != null)
            {
                Workshop.Dispose();
                Workshop = null;
            }

            if (Inventory != null)
            {
                Inventory.Dispose();
                Inventory = null;
            }

            if (Networking != null)
            {
                Networking.Dispose();
                Networking = null;
            }

            if (native != null)
            {
                native.Dispose();
                native = null;
            }

            System.Environment.SetEnvironmentVariable("SteamAppId", null);
            System.Environment.SetEnvironmentVariable("SteamGameId", null);
        }
        public virtual void Dispose()
        {
            foreach (var h in CallbackHandles)
            {
                h.Dispose();
            }
            CallbackHandles.Clear();

            if (Workshop != null)
            {
                Workshop.Dispose();
                Workshop = null;
            }

            if (Inventory != null)
            {
                Inventory.Dispose();
                Inventory = null;
            }

            if (Networking != null)
            {
                Networking.Dispose();
                Networking = null;
            }

            if (native != null)
            {
                native.Dispose();
                native = null;
            }
        }
Beispiel #3
0
        public virtual void Dispose()
        {
            if (disposed)
            {
                return;
            }

            Callbacks.Clear();

            foreach (var h in CallbackHandles)
            {
                h.Dispose();
            }
            CallbackHandles.Clear();

            foreach (var h in CallResults)
            {
                h.Dispose();
            }
            CallResults.Clear();

            if (Workshop != null)
            {
                Workshop.Dispose();
                Workshop = null;
            }

            if (Inventory != null)
            {
                Inventory.Dispose();
                Inventory = null;
            }

            if (Networking != null)
            {
                Networking.Dispose();
                Networking = null;
            }

            if (native != null)
            {
                try
                {
                    native.Dispose();
                }
                catch (DllNotFoundException e)
                {
                    System.Diagnostics.Debug.WriteLine("Disposing SteamWorks NativeInterface failed (" + e.Message + ")\n" + e.StackTrace);
                }
                native = null;
            }

            System.Environment.SetEnvironmentVariable("SteamAppId", null);
            System.Environment.SetEnvironmentVariable("SteamGameId", null);
            disposed = true;
        }