"The application is not open anymore"—what's the underlying cause?
It seems to be a not-uncommon problem for the Finder to report the "The application ___ is not open anymore." Some people never see this error message, but those of us who have seen it tend to see it repeatedly, and usually for the same apps. I've seen it several times, usually for one particular third-party app, but occasionally for others as well. I cannot recall having ever seen this prior to Yosemite.
The most commonly offered solution is to reboot, which consistently resolves the immediate manifestation of the issue but doesn't prevent it from recurring. Nor does replacing .plists or other persistent Library files provide a long-term resolution. Rebooting is not always a viable option at that moment. (For example, my most recent manifestation happened during a code compile. Not exactly something easy to interrupt and pick back up where it left off.) The error message itself follows the increasingly frustrating pattern of error messages that not only say nothing useful but also give a misleadingly inaccurate description of the problem. (When you're trying to launch an app, you're probably assuming that it's not open—if it were open, you wouldn't need to launch it again.)
Furthermore, while the error message says the app is not open, a restart attempt will usually fail initially with the message that the app is still running. So to some parts of the OS, the app is not running, but to others, it is. There is never any process visible in Activity Monitor or Terminal ps that is identifiably connected to the app in question, so there's nothing that can be force-quit or kill -9'ed.
So my question is: what is the actual issue that triggers OS X to present this particular error message? If I knew what was really going on, I might be able to contribute to finding a more permanent fix than simply rebooting every time it happens. The wording of the error suggests to me something related to App Nap and/or automatic application termination, but I have both disabled on my system, so my specific trigger likely comes from something else. I just don't know what that might be.
If I had to hazard a guess, based on what I know of the symptoms, I'd guess that there one or more temporary files of some kind that aren't getting closed properly when the app crashes, so that while the process ID itself is removed from the list of running processes, an open file pointer is still active that references the process. But I have not yet figured out what file(s) may be involved, or even if it's consistently the same file or files. And while it seems for any individual user who experiences the problem, the apps that it happens to are consistently the same ones, different users are all seeing it with different apps, which suggests to me that it's coming from something inherent to a particular OS installation, not just the app itself. That is, I think there's a call in the code of the affected apps that can trigger this error, but only when certain other circumstances are present.
That speculation is about at the limit of my under-the-hood knowledge, though, so while I've identified a reasonable starting point, I don't know what to do with that. So I'm hoping that some other inquisitive user with more code knowledge will see this and be inspired to help figure it out.
MacBook Pro (17-inch Mid 2010), OS X Yosemite (10.10.5)