Fix crash (Dmitry's code). When removing the last guide, KisGuidesManager removes itself from the list of event filters. And at the same time, the std-style loop is happening in the higher level. I prepared a patch that should fix the root of the problem. It does two things:
Makes the KisGuidesManager eat (accept) the event, when the guide is deleted. Add a safety check to KisInputManager. The loops checks the seqno of the filters list and if it got changed, simply exits the loops without accessing the iterator anymore.