Explorar o código

修复Session Call的cancel操作

tanghai %!s(int64=8) %!d(string=hai) anos
pai
achega
df78656cab
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      Unity/Assets/Scripts/Entity/Session.cs

+ 2 - 0
Unity/Assets/Scripts/Entity/Session.cs

@@ -239,6 +239,8 @@ namespace Model
 				}
 			};
 
+			cancellationToken.Register(()=>this.requestCallback.Remove(rpcId));
+
 			const byte flag = 0x80;
 			this.SendMessage(flag, opcode, rpcId, bytes);
 			return tcs.Task;