Skip to content

Commit

Permalink
fix termination
Browse files Browse the repository at this point in the history
  • Loading branch information
ranman committed Jun 24, 2014
1 parent b06dc41 commit 9ed3101
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions selfspy/sniff_cocoa.py
Expand Up @@ -62,14 +62,21 @@ def applicationDidFinishLaunching_(self, notification):
| NSFlagsChangedMask)
NSEvent.addGlobalMonitorForEventsMatchingMask_handler_(mask, sc.handler)

def applicationWillTerminate_(self, application):
def applicationWillResignActive(self, notification):
self.applicationWillTerminate_(notification)

def applicationShouldTerminate_(self, notification):
self.applicationWillTerminate_(notification)

def applicationWillTerminate_(self, notification):
# need to release the lock here as when the
# application terminates it does not run the rest the
# original main, only the code that has crossed the
# pyobc bridge.
if cfg.LOCK.is_locked():
cfg.LOCK.release()
print "Exiting ..."
print("Exiting ...")
return True

return AppDelegate

Expand Down

0 comments on commit 9ed3101

Please sign in to comment.