memory leaks!

DavidGL se04532____salleURL.edu
Fri Jul 14 16:21:10 CEST 2000


 Dear frank and agentpp's mailing list,

 I'm using the agent++ in an application, but when I close it after 
 debugging, I find that MS VC++ shows memory leaks. If I change the
 agent++'s objects and use pointers, when I delete them, I get the
 error:

    First-chance exception in FSMux.exe (NTDLL.DLL):
    0xC0000005: Access Violation.

 The code I use is the following (this is the way I get the 
 Access Violation, the memory leaks happen when I do use
 static objects instead of pointers):

 >-----------------------------------------------------------------------<

     ...

	volatile BOOL keepRunning;
	Snmpx* snmp;
	Mib* mib;
	RequestList* reqList;

     ...

 	int status;
	snmp=new Snmpx(status, 161);

	if(status!=SNMP_CLASS_SUCCESS)
	{
		AfxMessageBox("merda snmpx");
		return;
	}

	mib=new Mib;
	reqList=new RequestList;

	SetupMib();  // where I add MibLeafs to the mib
                     // but now I don't add any.

	mib->set_request_list(reqList);
	reqList->set_snmp(snmp); 

     ...

	Request* req=NULL;

	keepRunning=TRUE;

// in this moments, the next fragment of code is commented because
// I just want to test the leaks
/*
	while(keepRunning)
	{
		req=reqList->receive(1);
		if(req)
		{
			mib->process_request(req);
			req=NULL;
		}
	}
*/

     ...

	delete reqList;
	delete mib;
	delete snmp;

     ...

 >-----------------------------------------------------------------------<

 Does anyone know how to help me?
 Thanks in advance,
                     David.

 _________________________________________________________________________
 __/~~~~\___/~~~\__/~\_/~\_/~~~~~\_/~~~~\______/~~~\________/~\___________
 __/~\_/~\_/~\_/~\_/~\_/~\___/~\___/~\_/~\____/~\___________/~\___________
 __/~\_/~\_/~~~~~\_/~\_/~\___/~\___/~\_/~\____/~\_/~\_______/~\___________
 __/~\_/~\_/~\_/~\__/~~~\____/~\___/~\_/~\____/~\_/~\_/~~\__/~\_____/~~\__
 __/~~~~\__/~\_/~\___/~\___/~~~~~\_/~~~~\______/~~~~\_/~~\__/~~~~~\_/~~\__
 _________________________________________________________________________

 David Gonzalez i Lesmes                      e-mail: se04532 at salleURL.edu
                                              http:   //welcome.to/DavidGL
 Projecte FlowServer                          telf:     (+34) 93.290.24.28
 Centre de TeleVisió Digital (CeTVD)
 Enginyeria i Arquitectura La Salle. Universitat Ramon Llull





More information about the AGENTPP mailing list