Changed CAGradientLayer variable “gradient” to static so that the memory can be released from that CG instance when the view disappears.