NSRunningApplication returns isTerminated when it is not
| Originator: | peter | ||
| Number: | rdar://18892848 | Date Originated: | 2014-11-06 |
| Status: | Open | Resolved: | |
| Product: | OS X | Product Version: | Yosemite |
| Classification: | Reproducible: | Frequently |
My app is tracking runningApplications. It has ended up with an old NSRunningApplication object for the Finder, and a new one (frontApplication). Both objects match with "isEqual", but one returns isTerminated true and one returns isTerminated false. (lldb) po 0x61800010c600 <NSRunningApplication: 0x61800010c600 (com.apple.finder - 201)> (lldb) po 0x61000010a830 <NSRunningApplication: 0x61000010a830 (com.apple.finder - 201)> (lldb) print (bool)[0x61800010c600 isTerminated] (bool) $34 = true (lldb) print (bool)[0x61000010a830 isTerminated] (bool) $35 = false (lldb) print (bool)[0x61800010c600 isEqual:0x61000010a830] (bool) $36 = true Note that the low pid number for the Finder indicates the Finder has never relaunched since system boot time, so there is no reason the earlier NSRunningApplication object should be returning isTerminated as true. It appears that the NSRunningApplications returned from frontmostApplication are very fragile. The ones from runningApplications appear more robust, although even then they include cocoa applications that are still running that have isTermianted as true and processIdentifier as -1.
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!