out of type sequence



Hi all,

where did I do wrong so the server coredumps, and why can't I call
CORBA_sequence_get_release() against ptr within the do_modifyArray()
function (it also coredumps the server)?

Here is the echo.idl, and echo-server.c (yes I wrote it on the echo
samples :-)

Rgds,
Edwin.

echo.idl:

typedef sequence<short> vec;

interface Echo {
    void echoString(in string input);
    vec getArray(in short max);
    void modifyArray(out vec arr);
};

and the resulting Echo_modifyArray prototype:
void Echo_modifyArray(Echo _obj, vec ** arr, CORBA_Environment * ev);

echo-server.c:

void do_modifyArray(
    PortableServer_Servant _servant, 
    vec ** arr, 
    CORBA_Environment * ev)
{
    register int i;
    CORBA_boolean rel;
    
    vec *ptr = *(arr);

/*  if((rel = CORBA_sequence_get_release(ptr)) == FALSE) 
        return; 
*/

    if (ptr) 
    {
        CORBA_free(ptr);
    } 

    ptr = vec__alloc();
    ptr->_length = 10;
    ptr->_buffer = CORBA_sequence_CORBA_short_allocbuf(10);

    for (i = 0; i < 10; i++) 
        ptr->_buffer[i] = i * 20;
    CORBA_sequence_set_release(ptr, TRUE);
    g_message("I'm here! -5\n");
}




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