InterprocessConnection pure virtual call

Hello, I think this is an issue:

when using an InterprocessConnection with callbacksOnMessageThread = false, the destructor calls disconnect() which then call the connectionLost() callback. This thus causes a virtual call in the destructor, which is not safe.

My crappy workaround:

    if (!useMessageThread)
      callbackConnectionState = false;

This way, the callbackConnectionState does not change on disconnection, so that the callback is not called.


Thanks for spotting that one. Not a bad workaround, I’d say…

I suppose a nicer way to avoid the problem would be to call disconnect() in your subclass’s destructor, as that’d let the callback happen safely as well.