Re: How to deal with someone flirting with your girl in front of you?
Instead of focusing on protecting your girl, focusing on gaming the guy. If a guy came up to your girl and tried to game her, immediately join in on the conversation and draw his focus. Get a really great and entertaining conversation going, and then simply tell him "well, it was nice to meet / chat with you. I'll see you latter". Unless he's a jerk who doesn't get the point, he will bow out and leave whether he wants to or not.
In the past situation with your ex, you were absolutely right in withholding yourself. If you reacted to his flirting in a bad way, it would have left a huge negative impact on you. As with before, you definitely would have been able to stop him by engaging more with him instead of your girl. Get him involved with you and not so much your girlfriend. On the flip-side, when he isn't around, prove to your girl that you are a man of high caliber and interest.
Everything in a nutshell: reverse-psychology / alpha male game on the men, DHVs on the women.
"There is no better than adversity. Every defeat, every heartbreak, every loss, contains its own seed, its own lesson on how to improve your performance the next time." - Malcolm X