You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
First chance exception at $0127D4EC. Exception class $C0000005 with message 'access violation at 0x0127d4ec: read of address 0x00000000'. Process (72684)
报错代码位于 _Lock; 此时 TCrossWebSocket Self 指针已经是不可访问的对象了。并且此时的 FStatus 也已经是非法数据 Out of bound 垃圾的越界值,使用 if (FStatus = wsShutdown) then Exit; 判断,并不能起到实际作用。
不知是我哪里的处理的顺序有问题? 还是什么错误导致?
关闭代码是:
__WebSocket.Close;
__WebSocket := nil;
procedure TCrossWebSocket._OnOpenResponse(const AResponse: ICrossHttpClientResponse);
var
LOnOpenResponseEvents: TArray<TWsClientOnOpenResponse>;
LOnOpenResponseEvent: TWsClientOnOpenResponse;
begin
if (FStatus = wsShutdown) then Exit;
_Lock;
try
LOnOpenResponseEvents := FOnOpenResponseEvents.ToArray;
finally
_Unlock;
end;
for LOnOpenResponseEvent in LOnOpenResponseEvents do
if Assigned(LOnOpenResponseEvent) then
LOnOpenResponseEvent(AResponse);
end;
Net.CrossWebSocketClient.TCrossWebSocket._OnOpenResponse(TCrossHttpClientResponse($1CAC0BA8) as ICrossHttpClientResponse)
Net.CrossWebSocketClient.TCrossWebSocket.Open$ActRec.$1$Body(TCrossHttpClientResponse($1CAC0BA8) as ICrossHttpClientResponse)
Net.CrossHttpClient.TServerDock.DoRequest[0]$ActRec.$0$Body(TCrossHttpClientResponse($1CAC0BA8) as ICrossHttpClientResponse)
Net.CrossHttpClient.TCrossHttpClientRequest.SendNoCompress[0]$ActRec.$2$Body(TCrossHttpClientResponse($1CAC0BA8) as ICrossHttpClientResponse)
Net.CrossHttpClient.TCrossHttpClientResponse.TriggerResponseFailed(400,'Connection lost')
Net.CrossHttpClient.TCrossHttpClientSocket.LogicDisconnected(TCrossWebSocketClientConnection($9048570) as ICrossConnection)
Net.CrossWebSocketClient.TCrossWebSocketClient.LogicDisconnected(TCrossWebSocketClientConnection($9048570) as ICrossConnection)
Net.CrossSocket.Base.TCrossSocketBase.TriggerDisconnected(TCrossWebSocketClientConnection($9048570) as ICrossConnection)
Net.CrossSocket.Base.TCrossConnectionBase.Close
Net.CrossSocket.Base.TCrossSocketBase.CloseAllConnections
Net.CrossSocket.Base.TCrossSocketBase.CloseAll
Net.CrossSocket.Iocp.TIocpCrossSocket.StopLoop
Net.CrossWebSocketClient.TCrossWebSocketMgr.Destroy
System.TInterfacedObject._Release
System._IntfClear(???)
:007f1537 @IntfClear + $13
The text was updated successfully, but these errors were encountered:
当应用退出的时候,释放客户端的websocket,依然会触发OnResponse事件,导致非法访问的异常,此时websocket client对象已经被释放掉了。
First chance exception at $0127D4EC. Exception class $C0000005 with message 'access violation at 0x0127d4ec: read of address 0x00000000'. Process (72684)
报错代码位于 _Lock; 此时 TCrossWebSocket Self 指针已经是不可访问的对象了。并且此时的 FStatus 也已经是非法数据 Out of bound 垃圾的越界值,使用 if (FStatus = wsShutdown) then Exit; 判断,并不能起到实际作用。
不知是我哪里的处理的顺序有问题? 还是什么错误导致?
关闭代码是:
__WebSocket.Close;
__WebSocket := nil;
The text was updated successfully, but these errors were encountered: