I always lock myself in my room when I face big problems like losing someone I love, work and even losing money while gambling (my family understands my behavior). usually after 8 to 9 days, all my feelings will return to normal and start to get better. I really have a hard time hiding my behavior when I'm at a loss and it still happens to this day.
Even though your parents know this kind of behaviour I guess it is not ideal to stay yourself locked away in your room it is ideal to make an open up with your family and friends with that because its not good to your mental health they are there to help you and not to judge you.