Do you provide i.e. for math
static const axis2_svc_skeleton_ops_t math_svc_skeleton_ops_var = {
math_init,
math_invoke,
NULL,
math_free
};
Or do you provide
static const axis2_svc_skeleton_ops_t math_svc_skeleton_ops_var = {
math_init,
math_invoke,
NULL,
free
};
Also math_free is a skeleton function, and I think skeleton functions
are unknown to Axis2/C but to the client calling them.
But there are two more functions part of every implementation, and
(guess) they are more known to Axis2/C,
axis2_get_instance will create your math service (or any others) and
load the library while
axisx2_remove_instance will call AXIS2_SVC_SKELETON_FREE but only if
inst is still true at that time! (see below)
I think an automatic unload, calling free() somehow will only happen via
axis2_remove_instance
/**
* Following block distinguish the exposed part of the dll.
*/
AXIS2_EXPORT int
axis2_get_instance(
struct axis2_svc_skeleton **inst,
const axutil_env_t * env)
{
*inst = math_create(env);
if (!(*inst))
{
return AXIS2_FAILURE;
}
return AXIS2_SUCCESS;
}
AXIS2_EXPORT int
axis2_remove_instance(
axis2_svc_skeleton_t * inst,
const axutil_env_t * env)
{
axis2_status_t status = AXIS2_FAILURE;
if (inst)
{
status = AXIS2_SVC_SKELETON_FREE(inst, env);
}
return status;
}
Now see about axis2_remove_instance
Find all "axis2_remove_instance", Subfolders, Find Results 1, "Entire
Solution"
E:\asf\axis\axis2\c\core\trunk\src\core\receivers\raw_xml_in_out_msg_rec
v.c(439):axis2_remove_instance(
E:\asf\axis\axis2\c\core\trunk\src\modules\mod_addr\mod_addr.c(141):axis
2_remove_instance(
E:\asf\axis\axis2\c\core\trunk\src\core\transport\http\sender\http_trans
port_sender.c(853):axis2_remove_instance(
E:\asf\axis\axis2\c\core\trunk\src\core\transport\http\receiver\http_rec
eiver.c(508):axis2_remove_instance(
E:\asf\axis\axis2\c\core\trunk\util\include\axutil_utils.h(149):#define
AXIS2_DELETE_FUNCTION "axis2_remove_instance"
E:\asf\axis\axis2\c\core\trunk\src\core\transport\tcp\sender\tcp_transpo
rt_sender.c(481):axis2_remove_instance(
E:\asf\axis\axis2\c\core\trunk\src\core\transport\tcp\receiver\tcp_recei
ver.c(391):axis2_remove_instance(
E:\asf\axis\axis2\c\core\trunk\src\modules\mod_log\mod_log.c(131):axis2_
remove_instance(
E:\asf\axis\axis2\c\core\trunk\samples\server\echo\echo_skeleton.c(172):
axis2_remove_instance(
E:\asf\axis\axis2\c\core\trunk\samples\server\Calculator\calc_skeleton.c
(147):axis2_remove_instance(
E:\asf\axis\axis2\c\core\trunk\samples\server\math\math_skeleton.c(147):
axis2_remove_instance(
E:\asf\axis\axis2\c\core\trunk\samples\server\mtom\mtom_skeleton.c(154):
axis2_remove_instance(
E:\asf\axis\axis2\c\core\trunk\samples\server\notify\notify_skeleton.c(1
57):axis2_remove_instance(
Matching lines: 13 Matching files: 13 Total files searched: 650
You can see that skeletons have it and that modules have it and that
many axis2/c component have it ! the "axis2_remove_instance" routine.
AND show the map below ...
#define AXIS2_DELETE_FUNCTION "axis2_remove_instance"
Find all "AXIS2_DELETE_FUNCTION", Subfolders, Find Results 1, "Entire
Solution"
E:\asf\axis\axis2\c\core\trunk\util\include\axutil_utils.h(149):#define
AXIS2_DELETE_FUNCTION "axis2_remove_instance"
E:\asf\axis\axis2\c\core\trunk\util\src\class_loader.c(100):
delete_funct = (DELETE_FUNCT)AXIS2_PLATFORM_GETPROCADDR(dl_handler,
AXIS2_DELETE_FUNCTION);
Matching lines: 2 Matching files: 2 Total files searched: 650
So there is only one place in all Axis2/C sources where
AXIS2_DELETE_FUNCTION is used somehow and that is in "class_loader.c"
And inside the class_loader.c there is one place only
AXIS2_EXTERN void *AXIS2_CALL
axutil_class_loader_create_dll(
const axutil_env_t *env,
axutil_param_t *impl_info_param)
{
.....
Where AXIS2_DELETE_FUNCTION is used as shown above.
That is when the class loader has to create the dll ! when the
class_laoder.c creates the service, creates the module, creates the
http_receivers e all ....
But by doing my best, I can't find any other place where something like
a "class_unlaoder" will call AXIS2_DELETE_FUNCTION;
So it is very likely that this is an axis2/C bug
So it might be a good idea to call your xyz_free() yourself as you can't
count on axis2/c or apache to do it for you.
I have spent quite some time years ago when I was about to port axis2/c
to OpenVMS platform.
OpenVMS can load a library but never unload it! But dll's can do so
calling FreeLibrary()
Josef.Stadelmann
@axa-winterthur.ch
Von: Patrick Duflot [mailto:[email protected]]
Gesendet: Mittwoch, 12. Januar 2011 12:43
An: [email protected]
Betreff: free function of axis2 skeleton not called when running in
apache module
Hi list,
I have an axis2/c web service hosted under Apache 2.2.11.
I am using Axis/c 1.6.0
I am running under Windows XP
I provide a free function in my axis2_svc_skeleton_ops_t struct.
This function is never called when I stop the Apache process in Windows
service manager.
This function is neither called when I run Apache in console mode and I
close the console window.
Is this a bug in Axis2/c, in Apache or something else ?
Thank you