RE: OB 4.20 sp2 -> Java 5.0: pb with callbacks

"Fabrice Bouye" <[email protected]> Mon, 20 Jun 2005 08:01:07 +1100
Newsgroups gmane.comp.corba.orbacus
Message-ID <[email protected]>
Thanks for the tip about catching the JTCException. But aren't both class descending from std:exception ? I haven't looked at the sources yet.

After Google-ing for some time I finally found a way to fix the issue... It seems someone poste almost the exact same question in the ORBacus mailing list in 2001.

The answer is to use the _duplicate() method to avoid the reference from beeing released when the addSeapodymRCListener() method exits.

m_listenerMap.insert(ListenerPair(clientAddr, DSeapodymRCListener::_duplicate(listener)));

Everything works fine now when the fire method is executed and the clients receive the event update correctly.

In the original post the guy used a map of _ptr objects to store the references and some people warned him of possible memory leaks when releasing the references. I guess I'm Ok if I use _var objects instead, am I ?

---- 
Fabrice Bouyé (http://fabricebouye.cv.fm/) 
Research Officer (Data) 
Tel: +687 26 20 00 (Ext 411) 
Oceanic Fisheries, Pacific Community 
http://www.spc.int/ 

 
_______________________________________________
OB-Users Mailing List - [email protected]
http://mail.ooc.nf.ca/mailman/listinfo/ob-users
Visit our support FAQ before you send a message.
http://www.orbacus.com/faq/support.html