[omniORB] virtual distructor - once again

Andrei Zaparii zappa at yandex-team.ru
Tue Apr 6 19:43:49 BST 2004


Hello!
Let me describe my problem.
As a response to a interface member call i have to return big chunk of 
data (varying from 500k to 1m). To avoid memory copying i initialize 
sequence of octets via constructor
SomeSeq(_CORBA_ULong _max, _CORBA_ULong _len, CORBA::Octet* _val, 
_CORBA_Boolean _rel=0)
supplying pointer to my data and 0 as boolen flag to not free it. The 
Reason that i can not let ORB to free my data is that data is 
asynchronously generated and i use a kind of semaphore to determine when 
this data may be safely regenerated again. It is easy to obtain this 
semaphore. But with modern omniORB behaviour it is very dificult to free 
this semaphore. Since i can not easily determine when this data is sent 
and hence can be freed.
My solution is to inject empty virtual destructor for class SomeSeq 
generated by omniidl and then inherit from it to make my destructor to 
signal the semaphore properly. Postprocessing of the generated stuff is 
very undesireable. Manned editing of the generated header even more so.
So the question is: is there any other method to know when the data in 
sequence is not needed more (short of intereceptors)? Or can be option 
to omniidl added that will injects empty virtual destructors in 
generated classes?

-- 
Regards,
Andrei Zaparii



More information about the omniORB-list mailing list