Einzelnen Beitrag anzeigen

matmok

Registriert seit: 9. Feb 2006
Ort: Köln
22 Beiträge
 
Delphi 2007 Enterprise
 
#1

Memoryleak in TUdpSocket durch toggeln des Properties Active

  Alt 4. Jul 2008, 16:42
Hallo,

ich habe ein Memoryleak wenn ich einen TUdpSocket über das Property "Active" immer wieder an und ausschalte.

Beispiel:
Code:
TUdpSocket   *fUdpSocket;

fUdpSocket = new TUdpSocket(NULL);
while(true)
   {
   fUdpSocket->Active = true;
   Application->ProcessMessages();
   fUdpSocket->Active = false;
   }
delete fUdpSocket;
Was mache ich da falsch? nach ca. 400 mal kommt dann ein WSAENOBUFS Error ("No Buffer Space Available -- A socket operation could not be performed because the system ran out of buffer space or the queue was full."); Danach sogar ein BSOD (Bluescreen) wenn ich im Internetexplorer eine Seite aufrufen möchte...

auch ein komplettes Erzeugen und Freigeben nützt nichts:
Code:
TUdpSocket   *fUdpSocket;

while(true)
   {
   fUdpSocket = new TUdpSocket(NULL);
   fUdpSocket->Active = true;
   Application->ProcessMessages();
   fUdpSocket->Active = false;
   delete fUdpSocket;
   }
Ist das tatsächlich ein bug in der VCL? Kann ich das über API Funktionen wider ausbügeln?

(Ich arbeite mit CBuilder6 auf WinXP)

mfg,
Matmok
  Mit Zitat antworten Zitat