Function lignin::callback_registry::yet_more_unsafe_force_clear_callback_registry[][src]

pub unsafe fn yet_more_unsafe_force_clear_callback_registry()
Expand description

Clears the callback registry entirely and resets the total callback registration counter to zero.

Safety

Like with reset_callback_registry(), the caller must ensure that no currently existing CallbackRefs created from a dropped CallbackRegistration can have their .call(…) function invoked during or after this call.

Additionally, the caller (usually an unsafe app runner) must ensure that no currently existing CallbackRegistration instances are ever dropped. Failing this second condition doesn’t quite cause undefined behavior, but can cause unrelated parts of the app to misbehave and the callback registry to become poisoned immediately or later.

Please be very careful when using this. Practically any code in the entire app can violate the soundness condition in a difficult to track down way.