summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPietro Gagliardi <[email protected]>2014-03-01 14:08:53 -0500
committerPietro Gagliardi <[email protected]>2014-03-01 14:08:53 -0500
commitc8c257f8c84c163354a2b3ba7c97bd76f2700443 (patch)
tree5dee2b14eb7ead9d02dc7bfeffc79bd2e4dcc1a3
parentb6b8ee6a8227d544bae58192527743cdb13e61e8 (diff)
Fixed a minor startup failure on Mac OS X; now for a big one: apparently the thread that calls -[NSApplication run] is NOT the main thread...
-rw-r--r--uitask_darwin.go4
1 files changed, 3 insertions, 1 deletions
diff --git a/uitask_darwin.go b/uitask_darwin.go
index 4417528..3a6d633 100644
--- a/uitask_darwin.go
+++ b/uitask_darwin.go
@@ -100,7 +100,9 @@ func mainThread() {
mtret <- fmt.Errorf("error adding NSApplication delegate uitask: method (to do UI tasks): %v", err)
return
}
- appDelegate := objc_new(objc_getClass(_goAppDelegate))
+ // TODO using objc_new() causes a segfault; find out why
+ // TODO make alloc followed by init (I thought NSObject provided its own init?)
+ appDelegate := objc_alloc(objc_getClass(_goAppDelegate))
objc_setDelegate(_NSApp, appDelegate)
// and that's it, really
C.objc_msgSend_noargs(_NSApp, _run)