[omniORB] Problem with sequences
Cristi
bcristi@cti.ro
Wed, 19 May 1999 09:37:24 +0300
I have the following structure ('utilizator') and a sequence of elements of
this structure ('utilizatorVect')
==================================
struct utilizator {
CORBA::Long uID;
CORBA::String_member cont;
CORBA::String_member parola;
CORBA::String_member nume;
CORBA::String_member prenume;
CORBA::String_member adresa;
CORBA::String_member telefon;
CORBA::String_member email;
CORBA::Short activ;
size_t NP_alignedSize(size_t initialoffset) const;
void operator>>= (NetBufferedStream &) const;
void operator<<= (NetBufferedStream &);
void operator>>= (MemBufferedStream &) const;
void operator<<= (MemBufferedStream &);
};
typedef _CORBA_ConstrType_Variable_Var<utilizator> utilizator_var;
typedef _CORBA_Unbounded_Sequence<utilizator > utilizatorVect;
typedef _CORBA_Sequence_Var<utilizatorVect, utilizator >
utilizatorVect_var;
===============================
One of the methods of the object is (it's just for trying that it works):
===================================
CORBA::Long UserAdminLocalServer_i::ListaCompletaUtilizatori(utilizatorVect
*& utl_list) {
utilizatorVect* temp = new utilizatorVect();
temp->length(1);
(*temp)[0].cont = CORBA::string_dup((const char*)"frana");
(*temp)[0].parola = CORBA::string_dup((const char*)"aaa");
(*temp)[0].nume = CORBA::string_dup((const char*)"frana");
(*temp)[0].prenume = CORBA::string_dup((const char*)"ioan");
(*temp)[0].adresa = CORBA::string_dup((const char*)"xxx");
(*temp)[0].telefon = CORBA::string_dup((const char*)"1234");
(*temp)[0].email = CORBA::string_dup((const char*)"frana@xxx");
(*temp)[0].uID = (CORBA::Long)2;
(*temp)[0].activ = (CORBA::Short)1;
utl_list = temp;
delete temp;
return (CORBA::Long)1;
};
====================
And in the client:
====================
CORBA::ORB_ptr orb = CORBA::ORB_init(argc,argv,"omniORB2");
CORBA::BOA_ptr boa = orb->BOA_init(argc,argv,"omniORB2_BOA");
try {
CORBA::Object_var obj = getObjectReference(orb);
User_Admin_Local_Server::UserAdminLocalServer_var e =
User_Admin_Local_Server::UserAdminLocalServer::_narrow(obj);
if (CORBA::is_nil(e)) {
return;
}
User_Admin_Local_Server::UserAdminLocalServer::utilizatorVect* utl_list;
e->ListaCompletaUtilizatori(utl_list);
=======================
Could you tell me why the client crashes with a "Debug assertion failed"
(Expression: _BLOCK_TYPE_IS_VALID(pHead->nBlockUse)) when I call