Home Help Center

Custom Plug-In destroy procedure

DanielBDanielB Member Daniel BerlemontOrganization: Egidium TechnologiesProject: Network distributed interface applications
Hi !

This post is about a problem for which I found a solution, but I wish to know if my solution is reliable.

Here is the situation:
I develop a Server process that uses plug-ins designed with the ICE Plug-In API.
In the last plug-in development, I ran accross a problem on the plug-in destruction. In fact, it is the first plug-in that need to do an unsubscription from an IceStorm instance. However, when attempting to do so, the process stops unexpectedly with a NullHandleException (or an AssertionFailed on _proxyFactory, _outgoingConnectionFactory or _objectAdapterFactory in debug mode).
These errors lead me to get a look on "when" the plug-ins are destroyed. As expected, the destruction happens on the Communicator destruction, but it seems that some ressources of the Communicator (useful to make the unsubscription) are already destroyed when the "destroy" method of the plug-in is called. The "unsubscribe" invocation is failing.

The solution I found is to destroy the plug-in manager (by calling its "destroy" method) before the end of the Ice::Application "run" function (so before Communicator "destroy" is called).
It seems to work perfectly (no errors or crashes), but I can't be sure of the reliability of this behavior.

Is this solution a good one? Is there some things that I should care about by doing this way ?
Or is there another way to solve my situation ?

Thanks for reading,
Daniel

Comments

  • benoitbenoit Rennes, FranceAdministrators, ZeroC Staff Benoit FoucherOrganization: ZeroC, Inc.Project: Ice ZeroC Staff
    Hi Daniel,

    Destroying the plugin manager should be fine. Making a remote invocation from the plugin destroy method should definitely not cause an Ice::NullHandleException, we will look into fixing this for the next release, thanks for reporting this bug.

    Cheers,
    Benoit.
  • DanielBDanielB Member Daniel BerlemontOrganization: Egidium TechnologiesProject: Network distributed interface applications
    Thank you Benoit for your reply.
    You're welcome !
Sign In or Register to comment.