My boyfriend doesn't like me talking to my ex?

I'm a 22F and my boyfriend is the same age. My ex (same age), has bipolar disorder. It's hard for me to abandon him because I can't really abandon anybody, he has trauma and his issues. I don't love him like that anymore but he will occasionally flirt and makes jokes, knowing I have somebody. This isn't unusual because he does this with everyone due to his issues but my boyfriend gets upset by it. I don't want to just abandon him, because doing that to people hurts me since I don't ever want it done to me. How can I get my boyfriend to understand?
My boyfriend doesn't like me talking to my ex?
Post Opinion