Honestly I do it too. I miss her so much, but she’s move on, and it sucks.
For quit a spell, whenever i cut myself, or hurt myself, or was scared to death for any reason, i would call out my late husbands name in front of my current one. He understood, and i stopped doing it a few years into the relationship. You're not hurting anyone. Real relationships leave real impressions on us. I know that when I pass, I'll see this partner of mine that meant so much to me, again. I think thinking about him (without thought) just made me realize it. Friendship and love never dies.
I agree with SM.
But if you don't have a mental disorder, and if this is just kind of like a song running through your head, you can stop it. Just stop it. The moment you notice you're doing it, stop and think of something you've planned ahead to think about. Something boring and easy to think about. Like what will i fix for dinner. What will I wear to work tomorrow. Just start thinking of something else, that you plan ahead to switch to thinking about once your boyfriend's name pops into your head. If this doesn't help, you might need to talk to a doctor.
This is how you get any obsessive bothersome thought or song out of your head, absent mental illness.
Best wishes. This sounds like a habit.
Hi there and welcome. I'd consider talking to your doctor about this. Obsessive Compulsive disorder can be related to something like this. That is very treatable. So, talk to your doctor for a referral to a psychiatrist to examine these intrusive, compulsive thoughts.