|
반복적으로 쓰레드를 생성하고 처리하고 종료하는 루틴이 있습니다.
작업관리자에서 메모리를 확인해보면 핸들 수와 사용 메모리가 계속 증가하네요..
SampleThread::SampleThread(TIdContext *Context, void *Buffer, int Size) : Thread(false)
{
Priority = tpTimeCritical;
lpStream = new TMemoryStream();
lpStream->Write(Buffer, Size);
}
void __fastcall SampleThread::Execute(void)
{
Context->Connection->IOHandler->Write(lpStream, Buffer, Size);
delete lpStream;
Terminate();
delete this;
}
해제하지 못한 뭔가가 있는 것일까요?
|