Don't think I could ever be in a relationship

I'm not even talking about the fact that I will never attract a woman. Hypothetically, if I was able to attract someone, I don't think I could handle a relationship. I don't want to be vulnerable and to be perceived so closely by another person. I had a mini anxiety attack just now. After I got back to normal, I thought to myself that I wouldn't want someone to see me like this for example. I am too emotionally unstable to be with someone. Maybe I find comfort in isolation. I find safety in it. I feel like I can't be hurt if I have no one to be hurt by. I don't know if its just because I've been alone for so long that it feels like that's just how life is.