Your My_Highlightingrule class definition suggests you are storing both pattern and format. However, you delete pattern soon after and format is allocated on the stack. Meaning neither can be stored unless you've done a deep copy. If you need further help, how about posting the constructor for My_Highlightingrule.
Bookmarks