interface ServString {
short obtenerReg(in unsigned long iden, out REG_STRING str);
};
/****SERVER****/
CORBA::Short ServStringImpl::obtenerReg(CORBA::ULong _iden, REG_STRING_out _str)
{
_str=new REG_STRING;
(*_str).iden = 69;
(*_str).texto1 = CORBA::string_dup("texto provisional de pruebas reg...");
(*_str).texto2 = CORBA::string_dup("texto provisional de pruebas reg...");
(*_str).texto3 = CORBA::string_dup("texto provisional de pruebas reg...");
(*_str).texto4 = CORBA::string_dup("texto provisional de pruebas reg...");
return(0);
}
/****CLIENT****/
int main(){
while(1) func();
}
void func(){
short res;
REG_STRING_var str;
res = servString->obtenerReg(124172,str);
return;
}
/**********/
I can see (with the ps command) that the server has leak of memory.
I'm wrong. Why???
Thanks.