File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -42,10 +42,10 @@ public static void Register()
4242 public static void Unregister ( )
4343 {
4444 MyLog . Default . WriteLineAndConsole ( "TORCH MOD: Unregistering mod communication." ) ;
45- MyAPIGateway . Multiplayer . UnregisterMessageHandler ( NET_ID , MessageHandler ) ;
46- _closing = true ;
45+ MyAPIGateway . Multiplayer ? . UnregisterMessageHandler ( NET_ID , MessageHandler ) ;
4746 ReleaseLock ( ) ;
48- _task . Wait ( ) ;
47+ _closing = true ;
48+ //_task.Wait();
4949 }
5050
5151 private static void MessageHandler ( byte [ ] bytes )
@@ -183,13 +183,17 @@ public static void SendMessageToServer(MessageBase message)
183183
184184 private static void ReleaseLock ( )
185185 {
186+ if ( _lock == null )
187+ return ;
186188 while ( ! _lock . TryAcquireExclusive ( ) )
187189 _lock . ReleaseExclusive ( ) ;
188190 _lock . ReleaseExclusive ( ) ;
189191 }
190192
191193 private static void AcquireLock ( )
192194 {
195+ if ( _lock == null )
196+ return ;
193197 ReleaseLock ( ) ;
194198 _lock . AcquireExclusive ( ) ;
195199 _lock . AcquireExclusive ( ) ;
You can’t perform that action at this time.
0 commit comments