mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
chore: cleanup
This commit is contained in:
@@ -271,14 +271,16 @@ class TapHandlerImpl extends NSObject {
|
||||
public static initWithOwner(owner: WeakRef<Button>): TapHandlerImpl {
|
||||
let handler = <TapHandlerImpl>TapHandlerImpl.new();
|
||||
handler._owner = owner;
|
||||
|
||||
return handler;
|
||||
}
|
||||
|
||||
public tap(args) {
|
||||
let owner = this._owner.get();
|
||||
if (owner) {
|
||||
owner._emit(ButtonBase.tapEvent);
|
||||
// _owner is a {N} view which could get destroyed when a tap initiates (protect!)
|
||||
if (this._owner) {
|
||||
let owner = this._owner.get();
|
||||
if (owner) {
|
||||
owner._emit(ButtonBase.tapEvent);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user