From bd20050db8321fc2b25974dc6ed54bd59a4c8622 Mon Sep 17 00:00:00 2001 From: Alexandre Wilhelm Date: Wed, 20 Aug 2014 15:23:10 -0700 Subject: [PATCH] Fixed: added a boolean to avoid to addObservers seveal times --- AppKit/CPView.j | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/AppKit/CPView.j b/AppKit/CPView.j index 9fb8b6de4..8218bffd7 100644 --- a/AppKit/CPView.j +++ b/AppKit/CPView.j @@ -228,6 +228,8 @@ var CPViewFlags = { }, Function _toolTipFunctionIn; Function _toolTipFunctionOut; BOOL _toolTipInstalled; + + BOOL _isObserving; } /* @@ -844,14 +846,21 @@ var CPViewFlags = { }, while (count--) [_subviews[count] _removeObservers]; + + _isObserving = NO; } - (void)_addObservers { + if (_isObserving) + return; + var count = [_subviews count]; while (count--) [_subviews[count] _addObservers]; + + _isObserving = YES; } /*!