Commits

Anonymous committed e4a27e2

fix HelloWorld.py: keep a reference to the app delegate

Comments (0)

Files changed (1)

pyobjc/Examples/HelloWorld.py

 def main():
     NSApp = NSApplication.sharedApplication()
 
-    NSApp.setDelegate_( AppDelegate.alloc().init() )
+    delegate = AppDelegate.alloc().init()
+    NSApp.setDelegate_(delegate)
 
     win = NSWindow.alloc()
     frame = ((200.0, 300.0), (250.0, 100.0))