Hi Petr,
Great idea! I’ll surely do it this way. I’m now thinking (maybe you meant it that way, too) that the (real) factory itself could internally store a list of created sessions and close all of them (that are not closed) in the dtor - what do you think?
Yes, it should keep the list to verify that the session to be deleted was indeed created by that factory and not already deleted. The dtor would destroy the remaining sessions but the the users of the factory should nevertheless explicitly close their sessions using the interface provided by the factory.
Regards,
Peter
