I'm not suggesting a new system or a timeout. I'm suggesting passing a two sided handle (like a socket) where you can listen for the other end closing. Upon closing, which should only happen due to a bug or the process exiting, the notification bar can remove the icon. This is IPC 101.