Be aware that this library is not safe for use in a multithreaded application.
It contains synchronization but its design makes it impossible to use it safely easily (as described in its documentation).
Destructor of has_slots base class is called after the destructor of the derived class. So just image that a slot of the has_slots derived class is called (from a different thread) while you are in the middle of the destructor of the derived class (so the slot may e.g use a member pointer which points to an object which was already destroyed). The sigslot framework/library does not have any chance to avoid this call as it will know about the destruction only when the base class (has_slots) destructor is called.
You may call the disconnect_all at the beginning of your destructor but in this case it is quite useless to derive your class has_slots.
Log in to post a comment.