Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Presenting view controller memory leak #100

Open
reggian opened this issue May 23, 2022 · 0 comments
Open

Presenting view controller memory leak #100

reggian opened this issue May 23, 2022 · 0 comments

Comments

@reggian
Copy link

reggian commented May 23, 2022

The Wootric SDK stores the presenting view controller in a strong static reference and never releases it.

Stored in show survey method:

+ (void)showSurveyInViewController:(UIViewController *)viewController {
WTRSurvey *surveyClient = [WTRSurvey sharedInstance];
if ([surveyClient checkConfiguration]) {
[surveyClient survey:^(WTRSettings *settings){
[WTRLogger log:@"presenting survey view"];
_presentedViewController = viewController;
_presentedSettings = settings;
dispatch_async(dispatch_get_main_queue(), ^{
[self performSelector:@selector(presentSurveyInViewController:)
withObject:@[viewController, settings]
afterDelay:settings.timeDelay];
[[[WTRDefaultNotificationCenter alloc] initWithNotificationCenter:[NSNotificationCenter defaultCenter]] postNotificationName:[Wootric surveyWillAppearNotification] object:self];
[[Wootric delegate] willPresentSurvey];
});
}];
} else {
[WTRLogger log:@"Configure SDK first"];
}
}

Static variables:

static id<WTRSurveyDelegate> _delegate = nil;
static UIViewController *_presentedViewController;
static WTRSettings *_presentedSettings;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant