registerViewMouseListener closing issues

Let’s say I want to track mouse events from Controller class, so I am registering mouse listener from for example verifyView.
But closing the window causes an assert “View is still attached”. willClose is not always called (most times is, but not always, testing in FL64). How this can be done correctly and bulletproof?