I feel so bad...😢

So my boyfriend and I have been having a lot of fights lately about him not keeping jobs and stuff and I always go to my best friend to vent. Well last night when I was sleeping he decided to go through my texts from her and saw that I was talking shit about him and telling her how unhappy I’ve been. I just get so angry with him and I know I can go to her for anything and she will be there to let me vent. Well he got really angry with me and started yelling at me telling him if I’m going to talk shit about him to do it to him so he knows what he’s doing wrong. Which I understand where he’s coming from with that, but sometimes it’s just easier to vent to her about him then to start a brand new argument with him. Am I wrong?? Part of me thinks I am but then the other part doesn’t. He also didn’t like the fact that she constantly tells me to leave him...