Love before you leave

I left my last romantic relationship, because my partner showed multiple signs of emotional abuse, and I realized how much I got pulled into this and needed to get out to gain perspective. I was wondering, where is the line between – don’t leave because something feels bad in the moment, and staying in situations that are harming yourself? Would there maybe have been work to do for me in myself in that relationship that will come up again in the next one, or was it better to just get out without further harm? How would the concept of “leaving with love” and not in a rush apply to an – even worse – physical abusive relationship?