Destructor fix

fixes dangling event handler when an autoreload shader class is destroyed