         self.delegate?.draw?()
         let drawnImage = UIGraphicsGetImageFromCurrentImageContext()
         self.image = drawnImage
+        UIGraphicsEndImageContext()
 
         guard let _ = self.delegate?.draw else {
             self.timer?.invalidate()
             return
         }
+    }
+    deinit {
+        self.timer?.invalidate()
+        self.timer = nil
     }
 }
 

            self.firstcall = false
            self.delegate?.setup?()
        }
        // touch events
        if self.eventComponents.fingerTapped {
            self.eventComponents.fingerTapped = false


    public init() {
        super.init(frame: CGRect.zero)
        self.initializer()
        self.configuration()
        self.run()
    }
