Exemplo n.º 1
0
int destroy_valuefactory(void* data)
{
    etch_value_factory* vf = (etch_value_factory*)data;

    if (!is_etchobj_static_content(vf)) {
        etch_object_destroy(vf->impl);
    }

    return destroy_objectex((etch_object*)vf);
}
Exemplo n.º 2
0
/**
 * destroy_tagged_data_input()
 */
int destroy_tagged_data_input(void* data)
{
    tagged_data_input* tdi = (tagged_data_input*)data;

    if (!is_etchobj_static_content(tdi))
        etch_object_destroy(tdi->impl);

    destroy_objectex((etch_object*)tdi);
    return 0;
}
Exemplo n.º 3
0
/** 
 * destroy_type_impl()
 * etch_type_impl destructor
 */
int destroy_type_impl(void* data)
{
    etch_type_impl* impl = (etch_type_impl*)data;

    if (!is_etchobj_static_content(impl))
    {   /* destruction of the maps causes all fields and non-cached validator
         * objects, to be destroyed. see etchtype_fieldmap_clear_handler, 
         * and etchtype_vtormap_clear_handler, below. */
        etch_object_destroy(impl->vtormap);
        etch_object_destroy(impl->fieldmap);
        etch_object_destroy(impl->impexphelper);
    }

    return destroy_objectex((etch_object*)impl);
} 
/**
 * destroy_perf_server_impl()
 * perf_server_impl private destructor.
 * calls back to user destructor to effect cleanup of any perf_server_impl 
 * memory which may have been allocated in custom code added by user.
 */
int destroy_weblink_client_impl (void* data)
{
    weblink_client_impl* thisx = (weblink_client_impl*)data;
    if (NULL == thisx) return -1;  

    if (!is_etchobj_static_content(thisx))
    {    
        if(thisx->destroyex)
        {   /* call back to user memory destructor */
            thisx->destroyex(thisx);
        }
    }
            
    return destroy_objectex((etch_object*)thisx);
}
Exemplo n.º 5
0
/** 
 * destroy_type()
 * etch_type destructor
 */
int destroy_type(void* data)
{
    etch_type* type = (etch_type*)data;
    

    if (!is_etchobj_static_content(type)) /* e.g., not cloned */
    {          
        if (type->impl)
        {   etch_type_impl* impl = (etch_type_impl*) type->impl;
            etch_object_destroy(impl);
            type->impl = NULL;
        }
    }

    return destroy_id_name(type);
} 
Exemplo n.º 6
0
/**
 * destroy_mailbox()
 * destructor for etch_plainmailbox (etch_mailbox)
 */
int destroy_mailbox(void* data)
{
    etch_plainmailbox* thisx = (etch_plainmailbox*)data;

    if (!is_etchobj_static_content(thisx))
    {   
        const int is_locked = 0 == etchqueue_lock(thisx->queue);
        const int current_state = thisx->mailbox_state;
        thisx->mailbox_state = ETCH_MAILBOX_STATE_SHUTDOWN;
        if (is_locked) etchqueue_unlock(thisx->queue);

        if (current_state < ETCH_MAILBOX_STATE_CLOSED_READ)
        {   /* if the mailbox has not been closed, do it now. we do this
             * in order to close the queue, cancel any active timer, and  
             * reroute any messages remaining in the mailbox. */
            etchmbox_close_read(thisx->imailbox);
            etch_sleep(100);  /* todo: remove sleep when tested out */
        }

        if (thisx->impl)
           ((etch_object*) thisx->impl)->destroy(thisx->impl);

	
	    etch_object_destroy(thisx->queue);
	    thisx->queue = NULL;


	    etch_object_destroy(thisx->notify_state);
	    thisx->notify_state = NULL;


	    etch_object_destroy(thisx->lifetimer);
	    thisx->lifetimer = NULL;

        etch_mutex_destroy(thisx->readlock);
        thisx->readlock = NULL;

        /* debug heap issue note: this is/was the spot */
        etch_free(thisx->imailbox);  
    }

   return destroy_objectex((etch_object*) thisx);
}
Exemplo n.º 7
0
/*
 * destroy_packetizer()
 * etch_packetizer destructor
 */
int destroy_packetizer(void* data)
{
    etch_packetizer* thisx = (etch_packetizer*)data;
    etch_status_t status = ETCH_SUCCESS;
    if (NULL == thisx) return -1;

    if (!is_etchobj_static_content(thisx))
    {  
        etch_object_destroy(thisx->sessiondata);

        etch_object_destroy(thisx->transportpkt);

        if (thisx->datalock) {
            status = etch_mutex_destroy(thisx->datalock);
            ETCH_ASSERT(status == ETCH_SUCCESS);
        }

        etch_object_destroy(thisx->savebuf); 
    }
            
    return destroy_objectex((etch_object*)thisx);
}