PDFView zombie NSTimer crash
| Originator: | chad515 | ||
| Number: | rdar://11798708 | Date Originated: | 07/03/2012 |
| Status: | Open | Resolved: | No |
| Product: | Mac OS X | Product Version: | 10.7.4 |
| Classification: | Crash | Reproducible: | Sometimes |
When loading a PDF into a PDFView immediately after the PDFView has been loaded from a NIB, then releasing that PDFView a few seconds later, the PDFView tries to access a previously freed object which causes the app to crash. It appears what is happening is: 1) PDFView is loaded from NIB 2) PDFDocument is loaded into PDFView 3) PDFView calls -[PDFView(PDFViewInternal) handleInitialContentRenderSkip], which creates an NSTimer with the +[NSTimer timerWithTimeInterval:target:selector:userInfo:repeats:] method, but does not retain it 4) A few seconds later, the user closes the window, thereby releasing the PDFView 5) In the -[PDFView dealloc] method, -[NSTimer invalidate] is called on the previously freed NSTimer 6) The app crashes This does not happen every time. I believe it is most likely to happen when opening a larger PDF file for the first time (i.e. when it is not already in the filesystem cache and takes a bit longer to load).
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!