[omniORB] Getting a marshal Error

Olivier Thiboutot Olivier.Thiboutot at voxco.com
Wed Dec 21 08:34:32 GMT 2011


Hi Rajesh,

I would prefered using _var definition

Here is when the marshaling occurs your CustObj_Cont vctor_ is already destroy with the data since you are returning and destroying it before the real send is made over to the client, you need to let OmniOrb destroy it at the end of the sending process


CustObj_Cont* CustObj_implimentation::get_obj() throw
(CORBA::SystemException)
{

    CustObj_Cont_var vctor_var = new CustObj_Cont;
    CustObj obja;
 
    obja.val =10;

    vctor_var->length(1);
    vctor_var[0]=obja; // this does a deep copy of the object if I remembered

    return vctor_var._retn(); // this return the sequence (CustObj_Cont*) but also remove the reference return from the _var type to avoid deletion by this function.
}

Olivier Thiboutôt
olivier.thiboutot at voxco.com
Voxco Montréal | Développeur logiciel principal



More information about the omniORB-list mailing list