I think that happens if you let it.
You have the power to control what you're involved in. And consequently, you send a message to others about what you will tolerate when it comes to talk about yourself.
If you're sitting around and gossip starts happening, get up and leave. Tell them politely, you'd rather not be involved. They'll understand that you're not interested.
Gossip is such a turn-off. And for the record, I think there is a difference between discussing friends and just talking about shit. There's a difference between expressing concern/discussing with a purpose and being malicious.
People might talk about you if you do this, but at least you can feel confident that you did the right thing. You'll have no regrets. Gossip doesn't exist with everyone. I rarely see it or hear it. Although TRIBE has it's fair share, I know. But that's kind of unavoidable. Just do your part to avoid it.
Hope this helps.