Sometimes we deliberately behave badly just to make the other person hate us because it will benefit the other person.
Example: a boyfriend has some health problem and knows that he can't continue his life with her with his bad health. Then he behaves like he is not loving his girlfriend because she has to live a happy life with another.
I need a phrase or expression for behaving so.