各位同行,请教一个TIdHTTPServer子使用的问题。望赐教!
我在项目中用到TIdHTTPServer控件来接收客户端传过来数据,并做一些相应的处理。现在的问题是每一次用户连接后程序占用的内存就会增加,但不会减少,我在程序处理完成后已经将生成的对象 delete了。。。为什么还会这样。。是不是跟TIdHTTPServer控件有关。以下是我的程序代码。因为第一次使用到这个控件,不知道按照以下使用是否正确?户赐教。。。
void __fastcall TFrmMain::IdHTTPServer1CommandGet(TIdPeerThread *AThread,
TIdHTTPRequestInfo *ARequestInfo, TIdHTTPResponseInfo *AResponseInfo)
{
try
{
AnsiString urlString=this->getUrlMethod(ARequestInfo->Document);
MessageManage *message=new MessageManage();
AnsiString returnValue;
if(urlString !="")
{
if(urlString=="smsExSendMsg")
{
AnsiString userName,password,fromMobile,toMobile,msgContent,sendTime;
userName=ARequestInfo->Params->Values["user"];
password=ARequestInfo->Params->Values["password"];
fromMobile=ARequestInfo->Params->Values["fromMobile"];
toMobile=ARequestInfo->Params->Values["toMobile"];
msgContent=ARequestInfo->Params->Values["msg"];
sendTime=ARequestInfo->Params->Values["sendTime"];
returnValue=message->smsExSendMsg(userName,password,fromMobile,toMobile,msgContent,sendTime);
returnValue=this->returnSendHTML(returnValue);
AResponseInfo->ContentText=returnValue;
AResponseInfo->WriteContent();
}
}
delete message;
}
catch(...)
{
}