The situation
Last night I went to a bar after work to meet a friend to have a beer and catch up. There was a man "James" sitting next to us at the bar who had clearly taken an interest in our conversation, and after a few minutes, he jumped into it. I've met some very interesting people through random bar conversations (including the friend I was meeting last night), so I don't usually mind if people join conversations.
At first, the conversation with James was fairly normal. We finished the topic that he had jumped in on, made introduction, and then continued talking about a variety of topics. My friend and I started to get uncomfortable around the time we ordered a second beer. James insisted on paying and then interacted somewhat rudely with the bartender. What really crossed the line and cemented my friend's and my desire to end the conversation was when James was insistent that we try to "pick up" a couple of women, despite the fact that we had told him that we were both happily in relationships. He went so far as to approach a few women in the bar and insinuate that my friend and I were interested in them.
What we did
While James was distracted looking at the women in the bar, my friend and I manged to communicate with each other that we wanted to disassociate ourselves with him. We ultimately ended up closing our bar tabs and leaving.
What I'm looking for
In the future, how can I disassociate from a stranger at a bar who has latched on to my conversation without having to leave entirely? Ideally, I am looking for ways to do this non-confrontationally and without causing a scene (though I know this could be tricky if the stranger is inebriated).