Mark Salling was ''dealing with demons'' in the run up to his death.

The 'Glee' actor was awaiting sentencing after pleading guilty to possession of child pornography when he took his own life on Tuesday (30.01.18) and now a family source has revealed how he struggled over the past few years.

The family source told People magazine: ''His loved ones - actual loved ones - were absolutely shocked. In the last few years, we had very little contact. When you're living against your own morals or what you know to be right, you tend to avoid people who will hold up mirrors ... It's clear he was dealing with demons himself. The problem doesn't live in the existence of demons or pain or sexual appetites that began to skew as time went on. The inherent problem is that he did not seek help or have someone close enough to him willing to call it out ... As he continued to fight his demons - ultimately alone - there was some comfort there. I don't believe he ever intended harm ... but I do believe he was really sick and it severely clouded his judgement, which kept him living in an alternate reality.''

Salling's death was confirmed in a family statement released on Tuesday.

It read: ''I can confirm that Mark Salling passed away early this morning. Mark was a gentle and loving person, a person of great creativity, who was doing his best to atone for some serious mistakes and errors of judgment. He is survived by his mother and father, and his brother. The Salling family appreciates the support they have been receiving and asks for their privacy to be respected.''

Salling was expected to be sentenced to four and seven years behind bars in March after prosecutors found more than 50,000 child porn images in his possession.