Z
zag2000
Unregistered / Unconfirmed
GUEST, unregistred user!
在多个客户端不断调用同一个应用服务器的接口函数时,该接口函数有时会出现
内存访问的异常,如:Login Error: Access violation at address 004CA3EC in module 'AppServer.exe'. Read of address 00000016
不知道为什么,是Delphi的问题?如何解决?如Login接口函数:
procedure TDataService.Login(const ALoginName: WideString);
var
ListItem: TListItem;
begin
try
FLoginName := ALoginName;
ListItem := ServerMainFrm.lvLoginNameList.FindCaption(0,ALoginName,False,True,True);
if ListItem = nil then
begin
ServerMainFrm.UpdateClientCount(1);
ListItem := ServerMainFrm.lvLoginNameList.Items.Add;
ListItem.Caption := ALoginName;
ListItem.SubItems.Add('Count=1');
end
else
begin
ListItem.SubItems.Values['Count'] := IntToStr(StrToInt(ListItem.SubItems.Values['Count'])+1);
end;
except
on E: Exceptiondo
WriteLog('Time: ' + DateTimeToStr(Now) + ' Login Error: ' + E.Message);
end;
end;
内存访问的异常,如:Login Error: Access violation at address 004CA3EC in module 'AppServer.exe'. Read of address 00000016
不知道为什么,是Delphi的问题?如何解决?如Login接口函数:
procedure TDataService.Login(const ALoginName: WideString);
var
ListItem: TListItem;
begin
try
FLoginName := ALoginName;
ListItem := ServerMainFrm.lvLoginNameList.FindCaption(0,ALoginName,False,True,True);
if ListItem = nil then
begin
ServerMainFrm.UpdateClientCount(1);
ListItem := ServerMainFrm.lvLoginNameList.Items.Add;
ListItem.Caption := ALoginName;
ListItem.SubItems.Add('Count=1');
end
else
begin
ListItem.SubItems.Values['Count'] := IntToStr(StrToInt(ListItem.SubItems.Values['Count'])+1);
end;
except
on E: Exceptiondo
WriteLog('Time: ' + DateTimeToStr(Now) + ' Login Error: ' + E.Message);
end;
end;