-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[retain cycles] Add test that shows a missing part of the trace
Summary: We are missing the part about the execution of `hitViewInScrubber` that will explain how the cycle took place. Reviewed By: geralt-encore Differential Revision: D57496059 fbshipit-source-id: 3366358ab772635f31a2cf82d2ac5cfb6031eff2
- Loading branch information
1 parent
17e0130
commit 2880cfe
Showing
2 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 32 additions & 0 deletions
32
infer/tests/codetoanalyze/objc/pulse/retain_cycles/RetainCycleIncompleteTrace.m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* | ||
* Copyright (c) Facebook, Inc. and its affiliates. | ||
* | ||
* This source code is licensed under the MIT license found in the | ||
* LICENSE file in the root directory of this source tree. | ||
*/ | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@interface TestView : UIView | ||
@end | ||
|
||
@implementation TestView { | ||
UIView* _lastTouchedView; | ||
UIView* _timeRangeSelectorView; | ||
} | ||
|
||
- (void)_newGestureTypeFromGesture:(UIGestureRecognizer*)gesture { | ||
UIView* hitViewInScrubber = [self hitTest:[gesture locationInView:self] | ||
withEvent:nil]; | ||
_lastTouchedView = hitViewInScrubber; | ||
} | ||
|
||
- (UIView*)hitTest:(CGPoint)point withEvent:(UIEvent*)event { | ||
UIView* const hitView = [super hitTest:point withEvent:event]; | ||
if ((!hitView || hitView == self) && [self pointInside:point | ||
withEvent:event]) { | ||
return _timeRangeSelectorView; | ||
} | ||
return hitView; | ||
} | ||
@end |