How many chances

How many chances do you give your boyfriend to change his ways, I’ve given him more than enough now, he’s still coming back late being out with his friends or at his moms, he’s nearly 50 but still acting like a child. I’m pregnant with his child but he still treats me like shit..excuse my language but I’m so angry with myself, why can’t I just forget him and move on with my life it’s just so hard when I love him but he takes me for a fool because I am a fool for him anyway!!!! How do I just walk away from him without falling back to him