QLPreviewController is leaking on iOS 10

Hello,


I've the impression that QLPreviewController is leaking on iOS 10 (release version).

I've compiled the Apple DocInteraction sample, which push a QLPreviewController on a UINavigationController :


    QLPreviewController *previewController = [[QLPreviewController alloc] init];
    previewController.dataSource = self;
    previewController.delegate = self;
    [[self navigationController] pushViewController:previewController animated:YES];


When I pop the previewController, I can see with the new Xcode 8 object browser that there is still a leaving instance of a QLPreviewController.

If I subclass QLPreviewController:


@interface MYViewController : QLPreviewController
@end

@implementation MYViewController
- (void)dealloc {
}
@end


dealloc method is never called when the view controller is popped. With the same code on a iOS 8.1 simulator, dealloc is always called.


Can somebody confirms my investigation, or has any idea how to patch this leak ?


Thanks,


Jice

Yes, you are right. I have the same problems. Tested with iOS 9.3.5 - no Memory Problems. Same Code with iOS 10.1, memory increases every time when ill load a document into QLPreviewController, and gets never freed.

Thanks for the reply,


I've confirmed the leak also on iOS 10.0.2. I've created a radar on this issue (rdar://28318213),


Regards,


Jc

Same here - verified in profiler (Allocations).

Intrestingly - this only happens when pushing a QLPreviewController in a navigation controller, presenting QLPreviewController does not suffer from the leak

5 years old bug. I has same trouble.

QLPreviewController is leaking on iOS 10
 
 
Q