I am sorry to hear that you are going through what you are. I also have been in a relationship while suffering from depression. This is probably not what you want to hear but it is my experience that you are doing the right thing by getting yourself together and letting go of the relationship. This is only my opinion but I know first hand that no matter how devoted a person is to you, if your depression is not managed, it can destroy them as a person as well. I think that it is extremely mature on your part to recognize that this is a possible but difficult outlet for you to consider. Depression is a horrible thing and it can not only wound the person suffering, but those that love you the most.
Do your best to get healthy and then concentrate on letting your loved ones help you.
Good luck to you.