When she unintentionally does think about him and miss him, she has to recall the pain she's been through, so she will never go through it again.
If she finds herself thinking about him and missing him, she is forced to remember the suffering she experienced, which prevents her from experiencing that pain again.