File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,6 +23,7 @@ public class VRCFTPicoModule : ExtTrackingModule
2323 ) ;
2424 private static float _eyeGainX = 1.0f ;
2525 private static float _eyeGainY = 1.0f ;
26+ private volatile bool _shuttingDown ;
2627
2728 public override ( bool SupportsEye , bool SupportsExpression ) Supported => ( true , true ) ;
2829
@@ -139,17 +140,23 @@ private async Task<int> ListenOnPorts()
139140
140141 public override void Update ( )
141142 {
142- _updater ? . Update ( Status ) ;
143+ if ( _shuttingDown ) return ;
144+
145+ try
146+ {
147+ _updater ? . Update ( Status ) ;
148+ }
149+ catch ( AggregateException ex ) when ( ex . InnerException is ObjectDisposedException ) { }
150+ catch ( ObjectDisposedException ) { }
143151 }
144152
145153 public override void Teardown ( )
146154 {
155+ _shuttingDown = true ;
156+
147157 foreach ( var client in Clients )
148- {
149158 client . Dispose ( ) ;
150- }
151159 _udpClient . Dispose ( ) ;
152- _updater = null ;
153160 }
154161 private void LoadEyeGain ( )
155162 {
You can’t perform that action at this time.
0 commit comments