Steamworks.NET icon indicating copy to clipboard operation
Steamworks.NET copied to clipboard

Shutdown never releases unity editor process

Open joshbayley opened this issue 11 months ago • 1 comments

		internal static void Shutdown() {
			lock (m_sync) {
				--m_initCount;
				if (m_initCount == 0) {
					UnregisterAll();
					Marshal.FreeHGlobal(m_pCallbackMsg);
					m_pCallbackMsg = IntPtr.Zero;
				}
			}
		}

i added breakpoint here and confirmed that m_initCount == 0 when play mode exits but steam never releases the editor and its always in "running" state

#if UNITY_EDITOR
        void OnEnable()
        {
            EditorApplication.playModeStateChanged += HandlePlayModeState;
        }

        void OnDisable()
        {
            EditorApplication.playModeStateChanged -= HandlePlayModeState;
        }
        
        void HandlePlayModeState(PlayModeStateChange state)
        {
            if (state == PlayModeStateChange.ExitingPlayMode && _initialized)
            {
                Debug.Log("Shutting down SteamAPI...");
                SteamAPI.Shutdown();
                _initialized = false;
            }
        }
#endif  

shutdown logic on my side (similar to example manager)

this is troublesome for our team, any tips would be much appreciated, did search issues but no joy

joshbayley avatar Feb 14 '25 14:02 joshbayley

In fact, steam only detects whether the whole editor process is exited. I think this is related to your problem that your team don't restart editor every time when debug completed.

Akarinnnnn avatar Feb 17 '25 08:02 Akarinnnnn