@@ -12,7 +12,6 @@ internal class InputSystemPlugin : DeviceSimulatorPlugin
1212 internal Touchscreen SimulatorTouchscreen ;
1313
1414 private bool m_InputSystemEnabled ;
15- private bool m_Quitting ;
1615 private List < InputDevice > m_DisabledDevices ;
1716
1817 public override string title => "Input System" ;
@@ -22,9 +21,6 @@ public override void OnCreate()
2221 m_InputSystemEnabled = EditorPlayerSettingHelpers . newSystemBackendsEnabled ;
2322 if ( m_InputSystemEnabled )
2423 {
25- // Monitor whether the editor is quitting to avoid risking unsafe EnableDevice while quitting
26- UnityEditor . EditorApplication . quitting += OnQuitting ;
27-
2824 m_DisabledDevices = new List < InputDevice > ( ) ;
2925
3026 // deviceSimulator is never null when the plugin is instantiated by a simulator window, but it can be null during unit tests
@@ -99,27 +95,15 @@ public override void OnDestroy()
9995 deviceSimulator . touchScreenInput -= OnTouchEvent ;
10096 InputSystem . onDeviceChange -= OnDeviceChange ;
10197
102- UnityEditor . EditorApplication . quitting -= OnQuitting ;
103-
10498 if ( SimulatorTouchscreen != null )
10599 InputSystem . RemoveDevice ( SimulatorTouchscreen ) ;
106100 foreach ( var device in m_DisabledDevices )
107101 {
108- // Note that m_Quitting is used here to mitigate the problem reported in issue tracker:
109- // https://issuetracker.unity3d.com/product/unity/issues/guid/UUM-10774.
110- // Enabling a device will call into IOCTL of backend which will (may) be destroyed prior
111- // to this callback on Unity version <= 2022.2. This is not a fix for the actual problem
112- // of shutdown order but a package fix to mitigate this problem.
113- if ( device . added && ! m_Quitting )
102+ if ( device . added )
114103 InputSystem . EnableDevice ( device ) ;
115104 }
116105 }
117106 }
118-
119- private void OnQuitting ( )
120- {
121- m_Quitting = true ;
122- }
123107 }
124108}
125109
0 commit comments