Boost::signals2 - descruction of an object with the slot
问题 Consider this: #include <boost/signals2.hpp> #include <iostream> struct object_with_slot { void operator()() { std::cout << "Slot called!" << std::endl; member = 50500; } int member; }; int main() { boost::signals2::signal<void ()> sig; object_with_slot * ptr = new object_with_slot; sig.connect(*ptr); delete ptr; sig(); } Output is "Slot called!" and no crash or anything. That's why I have a few questions: 1) Why there is no crash? 2) Why there is no crash even if the slot function assigns