Ver código fonte

修复Session Call的cancel操作

tanghai 8 anos atrás
pai
commit
df78656cab
1 arquivos alterados com 2 adições e 0 exclusões
  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;