ORBit-2 server Mem leak with object factory



I get a slow mem leak in my server when repeatedly calling the object factory.
I'm sure I've missed something fundemental here. (I've made sure that the 
client test prog explicitly calls the Applications destructor using the 
logout function, so it not the client's fault)

The basic (edited) idl for this is:-

--------------------------------------------------------------------------
module MainServer{
	interface Applications{
			void applications(in stringlist commandline)
			void logout();
	};
	interface SessionManager{
			Applications login();		
	};
};
--------------------------------------------------------------------------

where SessionManager_Applications is the object factory, returning 
Applications objects, and logout destroys the Application object.



The *_create and *_destroy functions are as created by ORBit2, and so I have 
left them out of the code example (along with the exception handling and ior 
handling)
The server main prog goes something like:-


----------------------------------------------------------------------------
Applications
impl_MainServer_SessionManager_login(impl_POA_MainServer_SessionManager *
					 CORBA_Environment * ev);
void
impl_MainServer_Applications_logout(impl_POA_MainServer_Applications * 				   
                                    servant,CORBA_Environment * ev);



int main (int argc, char *argv[]){

CORBA_ORB orb;
CORBA_Environment ev;
PortableServer_POA root_poa;
PortableServer_POAManager mgr;
MainServer_SessionManager appl_client;

CORBA_exception_init(&ev);
orb = CORBA_ORB_init(&argc, argv, "orbit-local-orb", &ev);
root_poa = 
(PortableServer_POA)CORBA_ORB_resolve_initial_references(orb,"RootPOA", &ev); 
	
appl_client=impl_MainServer_SessionManager__create(root_poa,&ev);
mgr = PortableServer_POA__get_the_POAManager(root_poa, &ev);
PortableServer_POAManager_activate(mgr, &ev);
CORBA_ORB_run(orb, &ev);
return 0;
}




Applications
impl_MainServer_SessionManager_login(impl_POA_Session_Manager *
					  CORBA_Environment * ev)
{
   Applications retval;
   retval=impl_MainServer_Applications__create(servant->poa,ev);  
   return retval;
}

void
impl_MainServer_Applications_logout(impl_POA_Applications * servant,
				     CORBA_Environment * ev)
{
	impl_MainServer_Applications__destroy(servant,ev);
	return;
}
--------------------------------------------------------------------------




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]