void AXIS2_CALL axis2_udp_receiver_free( axis2_transport_receiver_t * trn_receiver, const axutil_env_t * env) { axis2_udp_receiver_impl_t * receiver = NULL; receiver = AXIS2_INTF_TO_IMPL(trn_receiver); if (!receiver) { AXIS2_LOG_ERROR (env->log, AXIS2_LOG_SI, "failure, receiver value is null , nothing to free"); return; } if (!receiver->stop) { receiver->stop = AXIS2_TRUE; } /* We do not free the conf_ctx as this is not the right place to do it */ receiver->conf_ctx = NULL; /* Close the sockets */ if (receiver->send_socket != AXIS2_INVALID_SOCKET) { axutil_network_handler_close_socket(env, receiver->send_socket); } /* we free this socket only if we owns it */ if (receiver->owns_socket && receiver->socket != AXIS2_INVALID_SOCKET) { axutil_network_handler_close_socket(env, receiver->socket); } if (receiver->mutex) { axutil_thread_mutex_destroy(receiver->mutex); } AXIS2_FREE(env->allocator, receiver); }
static void AXIS2_CALL axutil_log_impl_free( axutil_allocator_t *allocator, axutil_log_t *log) { axutil_log_impl_t *log_impl = NULL; if (log) { log_impl = AXUTIL_INTF_TO_IMPL(log); if (log_impl->mutex) { axutil_thread_mutex_destroy(log_impl->mutex); } if (log_impl->stream) { axutil_file_handler_close(log_impl->stream); } if (log_impl->file_name) { AXIS2_FREE(allocator, log_impl->file_name); } AXIS2_FREE(allocator, log_impl); } }
AXIS2_EXTERN void AXIS2_CALL axis2_callback_free( axis2_callback_t * callback, const axutil_env_t * env) { if (callback->mutex) { axutil_thread_mutex_destroy(callback->mutex); } AXIS2_FREE(env->allocator, callback); }
void AXIS2_CALL service_admin_counter_free( service_admin_counter_t *counter, const axutil_env_t *env) { if(counter->mutex) { axutil_thread_mutex_destroy(counter->mutex); counter->mutex = NULL; } if(counter) { AXIS2_FREE(env->allocator, counter); } }
AXIS2_EXTERN void AXIS2_CALL axis2_svc_free( axis2_svc_t * svc, const axutil_env_t * env) { if(!svc) { return; } if(svc->impl_class) { AXIS2_SVC_SKELETON_FREE((axis2_svc_skeleton_t *)svc->impl_class, env); } if(svc->param_container) { axutil_param_container_free(svc->param_container, env); } if(svc->flow_container) { axis2_flow_container_free(svc->flow_container, env); } if(svc->filename) { AXIS2_FREE(env->allocator, svc->filename); svc->filename = NULL; } if(svc->svc_desc) { AXIS2_FREE(env->allocator, svc->svc_desc); svc->svc_desc = NULL; } svc->parent = NULL; if(svc->module_list) { int i = 0; int size = 0; size = axutil_array_list_size(svc->module_list, env); for(i = 0; i < size; i++) { axutil_qname_t *qname = NULL; qname = axutil_array_list_get(svc->module_list, env, i); if(qname) { axutil_qname_free(qname, env); } } axutil_array_list_free(svc->module_list, env); } if(svc->schema_list) { axutil_array_list_free(svc->schema_list, env); } if(svc->engaged_module_list) { axutil_array_list_free(svc->engaged_module_list, env); } if(svc->axis_svc_name) { AXIS2_FREE(env->allocator, svc->axis_svc_name); svc->axis_svc_name = NULL; } if(svc->op_alias_map) { axutil_hash_index_t *hi = NULL; void *val = NULL; for(hi = axutil_hash_first(svc->op_alias_map, env); hi; hi = axutil_hash_next(env, hi)) { axutil_hash_this(hi, NULL, NULL, &val); if(val) { if(axis2_op_is_from_module((axis2_op_t *)val, env) == AXIS2_FALSE) { axis2_op_free((axis2_op_t *)val, env); } val = NULL; } } axutil_hash_free(svc->op_alias_map, env); } if(svc->op_action_map) { axutil_hash_index_t *hi = NULL; const void *key = NULL; for(hi = axutil_hash_first(svc->op_action_map, env); hi; hi = axutil_hash_next(env, hi)) { axutil_hash_this(hi, &key, NULL, NULL); if(key) { AXIS2_FREE(env->allocator, (axis2_char_t *)key); key = NULL; } } axutil_hash_free(svc->op_action_map, env); } if(svc->op_rest_map) { axis2_core_utils_free_rest_map(env, svc->op_rest_map); } if(svc->schema_target_ns_prefix) { AXIS2_FREE(env->allocator, svc->schema_target_ns_prefix); svc->schema_target_ns_prefix = NULL; } if(svc->target_ns) { AXIS2_FREE(env->allocator, svc->target_ns); svc->target_ns = NULL; } if(svc->wsdl_path) { AXIS2_FREE(env->allocator, svc->wsdl_path); svc->wsdl_path = NULL; } if(svc->folder_path) { AXIS2_FREE(env->allocator, svc->folder_path); svc->folder_path = NULL; } if(svc->target_ns_prefix) { AXIS2_FREE(env->allocator, svc->target_ns_prefix); svc->target_ns_prefix = NULL; } if(svc->qname) { axutil_qname_free(svc->qname, env); } if(svc->style) { AXIS2_FREE(env->allocator, svc->style); } if(svc->base) { axis2_desc_free(svc->base, env); } if(svc->mutex) { axutil_thread_mutex_destroy(svc->mutex); } AXIS2_FREE(env->allocator, svc); }
AXIS2_EXTERN void AXIS2_CALL axis2_conf_ctx_free( axis2_conf_ctx_t * conf_ctx, const axutil_env_t * env) { if(conf_ctx->base) { axis2_ctx_free(conf_ctx->base, env); } if(conf_ctx->op_ctx_map) { axutil_hash_index_t *hi = NULL; void *val = NULL; for(hi = axutil_hash_first(conf_ctx->op_ctx_map, env); hi; hi = axutil_hash_next(env, hi)) { axis2_op_ctx_t *op_ctx = NULL; axutil_hash_this(hi, NULL, NULL, &val); op_ctx = (axis2_op_ctx_t *)val; if(op_ctx) axis2_op_ctx_free(op_ctx, env); val = NULL; op_ctx = NULL; } axutil_hash_free(conf_ctx->op_ctx_map, env); } if(conf_ctx->svc_ctx_map) { axutil_hash_index_t *hi = NULL; void *val = NULL; for(hi = axutil_hash_first(conf_ctx->svc_ctx_map, env); hi; hi = axutil_hash_next(env, hi)) { axis2_svc_ctx_t *svc_ctx = NULL; axutil_hash_this(hi, NULL, NULL, &val); svc_ctx = (axis2_svc_ctx_t *)val; if(svc_ctx) axis2_svc_ctx_free(svc_ctx, env); val = NULL; svc_ctx = NULL; } axutil_hash_free(conf_ctx->svc_ctx_map, env); } if(conf_ctx->svc_grp_ctx_map) { axutil_hash_index_t *hi = NULL; void *val = NULL; for(hi = axutil_hash_first(conf_ctx->svc_grp_ctx_map, env); hi; hi = axutil_hash_next(env, hi)) { axis2_svc_grp_ctx_t *svc_grp_ctx = NULL; axutil_hash_this(hi, NULL, NULL, &val); svc_grp_ctx = (axis2_svc_grp_ctx_t *)val; if(svc_grp_ctx) axis2_svc_grp_ctx_free(svc_grp_ctx, env); val = NULL; svc_grp_ctx = NULL; } axutil_hash_free(conf_ctx->svc_grp_ctx_map, env); } if(conf_ctx->conf) { axis2_conf_free(conf_ctx->conf, env); } if(conf_ctx->mutex) { axutil_thread_mutex_destroy(conf_ctx->mutex); } if(conf_ctx->root_dir) { AXIS2_FREE(env->allocator, conf_ctx->root_dir); } AXIS2_FREE(env->allocator, conf_ctx); }