Number: rdar://28318213
Date Originated: 15-Sep-2015 01:00 PM
Status:
Resolved:
Product: iOS
Version: 10
Classification: Other Bug
Reproducible: Always
When using QLPreviewController to preview a document (like a PDF file), instances are still leaving in memory even if the view controller is not used any more.
- Download Apple DocInteraction sample
- Compile it with Xcode 8 / iOS 10
- Run
- Tap the first link to push Text Document.txt
- Tap the back button to pop the QLPreviewController
- Use Xcode 8 objects browser and look for instance of QLPreviewController UIViewController. There is one leaving instance whereas the view controller have been oped and should not be present in the view hierarchy.
Alternatively:
-
Modify the sample and subclass QLPreviewController:
@interface MYViewController : QLPreviewController @end @interface MYViewController () @end @implementation MYViewController - (void)dealloc { } @end
-
Run
-
Put a breakpoint in MYViewController's dealloc
-
Tap the first link to push Text Document.txt
-
Tap the back button to pop the QLPreviewController
-
Breakpoint in dealloc is not raised, the instance of MYViewController is leaking
Not QLPreviewController instance should remain in memory after the view controller have been popped.
QLPreviewController instances remain in memory after the view controller have been popped.
iOS 10.0.1 (14A403)
iPhone SE 32 Go