I have some code that works like:

  my $result_object = $search_object->query($query);

I'd like to prevent $search_object from being destroyed until
$results_object is gone.  Normally I could do

    $results_object->{parent} = $search_object;

But in this case $results_object is a pointer to a C struct
not a hash (or an array).

Are there any options other than returning a blessed array or hash ref as
my object?

Thanks,


Here's the real code:

   $results = $swish->SwishQuery($query);

so the current xs code is:

SW_RESULTS
SwishQuery( swish_handle, query = NULL )
    SW_HANDLE swish_handle
    char *query

    PREINIT:
        char * CLASS = "SWISH::API::Results";


Where SW_RESULTS is a O_OBJECT typemap.

O_OBJECT
        sv_setref_pv( $arg, CLASS, (void*)$var );


-- 
Bill Moseley [EMAIL PROTECTED]

Reply via email to