Hello,

> You can keep a global flag to set when the callback is finish calling. and
> may be in a while loop you can check that flag and free if it is set. I'm

No, I can't. Because the axis framework / generated code is using the stub data 
after the user-callback. So when signaling another thread to cleanup, you run 
the risk the other thread cleans up before the framework stops using the data 
-> crash.

> not sure whether this fit to your application. Another option is passing
> stub as the data in the callback and free it.

That's just what I tried, but that has the same result: The framwork is using 
the stub after the usser callback. So freeing the stub data in the user 
callback will result in a crash.
 
> But you can't free the env variable either way. That's should be created at
> the start of the app and free at the end of it. Anyway if you want to do

Our application highly relies on multi-threading. The environment can't be 
shared between threads (the error structure is in it). So each thread needs to 
allocate it's own environment. Since it can't be predicted which worker thread 
is going to call what and when, we create an environment for each call and free 
it after that call, using axutil_env_create_with_error_log_thread_pool() and 
axutil_env_free_masked() so we only allocate and free the error structure.
A strange thing I noticed is that the refcount for the environment is never 1 
after a call...

> that you may have to edit the generated stub call.

I think the problem is not only the generated code (that uses only the 
allocator, and we can get around that by changing the code to free the 
call-back data prior to calling the callback). But the framwork is using that 
data too.
 
Regards,

-- 

 
Patrick van Beem
Sr. Software engineer
 
Quintiq
 
T +31 (0) 73 691 07 39
F +31 (0) 73 691 07 54
M +31 (0) 06 15 01 65 83
E [EMAIL PROTECTED]
I www.quintiq.com



This message contains information that may be privileged or confidential and is 
the property of Quintiq. It is only intended for the person to whom it is 
addressed. If you are not the intended recipient, you are not authorized to 
read, print, retain, copy, disseminate, distribute or use this message or any 
part thereof. If you have received this message in error, please notify the 
sender immediately and delete all copies of this message. Please note that 
e-mails are susceptible to change, therefore they are not binding.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to