Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Memory leak. Bug or error???

1 view
Skip to first unread message

Manuel Martinez

unread,
Oct 30, 2001, 10:36:06 AM10/30/01
to
Hi;
Visibroker 4.0 (Windows 2k) Client
Visibroker 4.1 (Solaris 8) Server
/****IDL****/
struct REG_STRING {
unsigned long iden;
string texto1;
string texto2;
string texto3;
string texto4;
};

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.

0 new messages