From 44a3b32fa62327805fa03d9fbcbf578623c1251f Mon Sep 17 00:00:00 2001 From: Tsvetan Raikov Date: Wed, 17 Aug 2016 16:09:38 +0300 Subject: [PATCH] Fixed: There is an exception when removing a button --- tns-core-modules/ui/button/button.ios.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/tns-core-modules/ui/button/button.ios.ts b/tns-core-modules/ui/button/button.ios.ts index 3dd18d0fb..9954b1b85 100644 --- a/tns-core-modules/ui/button/button.ios.ts +++ b/tns-core-modules/ui/button/button.ios.ts @@ -69,6 +69,13 @@ export class Button extends common.Button { this.style._updateTextTransform(); } + public onUnloaded() { + super.onUnloaded(); + if (this._stateChangedHandler) { + this._stateChangedHandler.stop(); + } + } + @PseudoClassHandler("normal", "highlighted") _updateHandler(subscribe: boolean) { if (subscribe) {