{"action":"created","issue":{"url":"https://api.github.com/repos/mono/MonoGame/issues/3875","labels_url":"https://api.github.com/repos/mono/MonoGame/issues/3875/labels{/name}","comments_url":"https://api.github.com/repos/mono/MonoGame/issues/3875/comments","events_url":"https://api.github.com/repos/mono/MonoGame/issues/3875/events","html_url":"https://github.com/mono/MonoGame/issues/3875","id":80421623,"number":3875,"title":"Crash in Mac OSX - GamePad","user":{"login":"kjpou1","id":640466,"avatar_url":"https://avatars.githubusercontent.com/u/640466?v=3","gravatar_id":"","url":"https://api.github.com/users/kjpou1","html_url":"https://github.com/kjpou1","followers_url":"https://api.github.com/users/kjpou1/followers","following_url":"https://api.github.com/users/kjpou1/following{/other_user}","gists_url":"https://api.github.com/users/kjpou1/gists{/gist_id}","starred_url":"https://api.github.com/users/kjpou1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kjpou1/subscriptions","organizations_url":"https://api.github.com/users/kjpou1/orgs","repos_url":"https://api.github.com/users/kjpou1/repos","events_url":"https://api.github.com/users/kjpou1/events{/privacy}","received_events_url":"https://api.github.com/users/kjpou1/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/mono/MonoGame/labels/MacOS","name":"MacOS","color":"9600fd"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-25T06:58:21Z","updated_at":"2015-05-25T13:15:48Z","closed_at":"2015-05-25T13:15:48Z","body":"Current Development branch as of May 25 When overriding the update method in the Game:\r\n\r\n        protected override void Update(GameTime gameTime)\r\n        {\r\n            base.Update(gameTime);\r\n\r\n            // Allows the game to exit\r\n            #if (WINDOWS && !NETFX_CORE) || WINDOWSGL || WINDOWSDX || MACOS\r\n            if (GamePad.GetState(PlayerIndex.One).Buttons.Back == ButtonState.Pressed)\r\n            Exit();\r\n            #endif\r\n        }\r\n\r\nCalling the GamePad.GetState here causes the following crash:\r\n\r\n2015-05-25 08:53:10.820 CocosSharpTests[53100:1772618] _createMenuRef called with existing principal MenuRef already associated with menu\r\n2015-05-25 08:53:10.821 CocosSharpTests[53100:1772618] (\r\n\t0   CoreFoundation                      0x90fe2c63 __raiseError + 195\r\n\t1   libobjc.A.dylib                     0x9aa73a2a objc_exception_throw + 276\r\n\t2   CoreFoundation                      0x90fe2b7d +[NSException raise:format:] + 141\r\n\t3   AppKit                              0x95fe2193 -[NSCarbonMenuImpl _createMenuRef] + 70\r\n\t4   AppKit                              0x95fe1924 -[NSCarbonMenuImpl _instantiateCarbonMenu] + 155\r\n\t5   AppKit                              0x95fe187e -[NSCarbonMenuImpl setupCarbonMenuBar] + 40\r\n\t6   AppKit                              0x95fdfddd -[NSApplication finishLaunching] + 1398\r\n\t7   ???                                 0x104b3204 0x0 + 273363460\r\n\t8   ???                                 0x104b2094 0x0 + 273358996\r\n\t9   ???                                 0x027ddc40 0x0 + 41802816\r\n\t10  libUnable to determine number of joysticks.\r\nObject reference not set to an instance of an object\r\nmono-2.0.dylib                   0x0040ec8f mono_jit_runtime_invoke + 751\r\n\t11  libmono-2.0.dylib                   0x005d0baf mono_runtime_invoke + 127\r\n\t12  libmono-2.0.dylib                   0x005d10da mono_runtime_class_init_full + 778\r\n\t13  libmono-2.0.dylib                   0x0040bc17 mono_jit_compile_method_with_opt + 4119\r\n\t14  libmono-2.0.dylib                   0x0040aba9 mono_jit_compile_method + 57\r\n\t15  libmono-2.0.dylib                   0x004c0d91 common_call_trampoline + 961\r\n\t16  libmono-2.0.dylib                   0x004c09bc mono_magic_trampoline + 60\r\n\t17  ???                                 0x007ef088 0x0 + 8319112\r\n\r\nThe calling line is https://github.com/mono/MonoGame/blob/develop/MonoGame.Framework/Input/GamePad.OpenTK.cs#L84\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/mono/MonoGame/issues/comments/105230081","html_url":"https://github.com/mono/MonoGame/issues/3875#issuecomment-105230081","issue_url":"https://api.github.com/repos/mono/MonoGame/issues/3875","id":105230081,"user":{"login":"kjpou1","id":640466,"avatar_url":"https://avatars.githubusercontent.com/u/640466?v=3","gravatar_id":"","url":"https://api.github.com/users/kjpou1","html_url":"https://github.com/kjpou1","followers_url":"https://api.github.com/users/kjpou1/followers","following_url":"https://api.github.com/users/kjpou1/following{/other_user}","gists_url":"https://api.github.com/users/kjpou1/gists{/gist_id}","starred_url":"https://api.github.com/users/kjpou1/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kjpou1/subscriptions","organizations_url":"https://api.github.com/users/kjpou1/orgs","repos_url":"https://api.github.com/users/kjpou1/repos","events_url":"https://api.github.com/users/kjpou1/events{/privacy}","received_events_url":"https://api.github.com/users/kjpou1/received_events","type":"User","site_admin":false},"created_at":"2015-05-25T13:15:48Z","updated_at":"2015-05-25T13:15:48Z","body":"Thanks @cra0zy will close as duplicate"}}