{"action":"created","comment":{"url":"https://api.github.com/repos/highfidelity/hifi/pulls/comments/24686795","id":24686795,"diff_hunk":"@@ -516,21 +518,33 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :\n \n void Application::aboutToQuit() {\n     _aboutToQuit = true;\n+    \n+    cleanupBeforeQuit();\n }\n \n-Application::~Application() {\n+void Application::cleanupBeforeQuit() {\n     QMetaObject::invokeMethod(&_settingsTimer, \"stop\", Qt::BlockingQueuedConnection);\n     _settingsThread.quit();\n     saveSettings();\n     \n+    // TODO: now that this is in cleanupBeforeQuit do we really need it to stop and force\n+    // an event loop to send the packet?\n+    UserActivityLogger::getInstance().close();\n+    \n+    // stop the AudioClient\n+    QMetaObject::invokeMethod(DependencyManager::get<AudioClient>().data(),\n+                              \"stop\", Qt::BlockingQueuedConnection);\n+    \n+    // destroy the AudioClient so it and its thread have a chance to go down safely\n+    DependencyManager::destroy<AudioClient>();\n+}\n+\n+Application::~Application() {    \n     _entities.getTree()->setSimulation(NULL);\n     qInstallMessageHandler(NULL);\n     \n     _window->saveGeometry();\n     \n-    int DELAY_TIME = 1000;\n-    UserActivityLogger::getInstance().close(DELAY_TIME);\n-    \n     // make sure we don't call the idle timer any more\n     delete idleTimer;\n     ","path":"interface/src/Application.cpp","position":57,"original_position":57,"commit_id":"e3475d4d7faae747a84805d6d1154baaba10ebb0","original_commit_id":"e3475d4d7faae747a84805d6d1154baaba10ebb0","user":{"login":"AndrewMeadows","id":2186405,"avatar_url":"https://avatars.githubusercontent.com/u/2186405?v=3","gravatar_id":"","url":"https://api.github.com/users/AndrewMeadows","html_url":"https://github.com/AndrewMeadows","followers_url":"https://api.github.com/users/AndrewMeadows/followers","following_url":"https://api.github.com/users/AndrewMeadows/following{/other_user}","gists_url":"https://api.github.com/users/AndrewMeadows/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewMeadows/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewMeadows/subscriptions","organizations_url":"https://api.github.com/users/AndrewMeadows/orgs","repos_url":"https://api.github.com/users/AndrewMeadows/repos","events_url":"https://api.github.com/users/AndrewMeadows/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewMeadows/received_events","type":"User","site_admin":false},"body":"On second thought, I don't think this input should block this PR.  I'll make the changes myself when I rework my own PR.  Carry on.","created_at":"2015-02-13T18:54:28Z","updated_at":"2015-02-13T18:54:28Z","html_url":"https://github.com/highfidelity/hifi/pull/4279#discussion_r24686795","pull_request_url":"https://api.github.com/repos/highfidelity/hifi/pulls/4279","_links":{"self":{"href":"https://api.github.com/repos/highfidelity/hifi/pulls/comments/24686795"},"html":{"href":"https://github.com/highfidelity/hifi/pull/4279#discussion_r24686795"},"pull_request":{"href":"https://api.github.com/repos/highfidelity/hifi/pulls/4279"}}},"pull_request":{"url":"https://api.github.com/repos/highfidelity/hifi/pulls/4279","id":29220543,"html_url":"https://github.com/highfidelity/hifi/pull/4279","diff_url":"https://github.com/highfidelity/hifi/pull/4279.diff","patch_url":"https://github.com/highfidelity/hifi/pull/4279.patch","issue_url":"https://api.github.com/repos/highfidelity/hifi/issues/4279","number":4279,"state":"open","locked":false,"title":"fix cleanup of AudioClient, avoid gvr-interface crash on OS X","user":{"login":"birarda","id":724069,"avatar_url":"https://avatars.githubusercontent.com/u/724069?v=3","gravatar_id":"","url":"https://api.github.com/users/birarda","html_url":"https://github.com/birarda","followers_url":"https://api.github.com/users/birarda/followers","following_url":"https://api.github.com/users/birarda/following{/other_user}","gists_url":"https://api.github.com/users/birarda/gists{/gist_id}","starred_url":"https://api.github.com/users/birarda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/birarda/subscriptions","organizations_url":"https://api.github.com/users/birarda/orgs","repos_url":"https://api.github.com/users/birarda/repos","events_url":"https://api.github.com/users/birarda/events{/privacy}","received_events_url":"https://api.github.com/users/birarda/received_events","type":"User","site_admin":false},"body":null,"created_at":"2015-02-12T22:00:53Z","updated_at":"2015-02-13T18:54:28Z","closed_at":null,"merged_at":null,"merge_commit_sha":"ed8ec347af8cf7fed1f0a27998ee45c340895feb","assignee":{"login":"AndrewMeadows","id":2186405,"avatar_url":"https://avatars.githubusercontent.com/u/2186405?v=3","gravatar_id":"","url":"https://api.github.com/users/AndrewMeadows","html_url":"https://github.com/AndrewMeadows","followers_url":"https://api.github.com/users/AndrewMeadows/followers","following_url":"https://api.github.com/users/AndrewMeadows/following{/other_user}","gists_url":"https://api.github.com/users/AndrewMeadows/gists{/gist_id}","starred_url":"https://api.github.com/users/AndrewMeadows/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndrewMeadows/subscriptions","organizations_url":"https://api.github.com/users/AndrewMeadows/orgs","repos_url":"https://api.github.com/users/AndrewMeadows/repos","events_url":"https://api.github.com/users/AndrewMeadows/events{/privacy}","received_events_url":"https://api.github.com/users/AndrewMeadows/received_events","type":"User","site_admin":false},"milestone":null,"commits_url":"https://api.github.com/repos/highfidelity/hifi/pulls/4279/commits","review_comments_url":"https://api.github.com/repos/highfidelity/hifi/pulls/4279/comments","review_comment_url":"https://api.github.com/repos/highfidelity/hifi/pulls/comments/{number}","comments_url":"https://api.github.com/repos/highfidelity/hifi/issues/4279/comments","statuses_url":"https://api.github.com/repos/highfidelity/hifi/statuses/e3475d4d7faae747a84805d6d1154baaba10ebb0","head":{"label":"birarda:android","ref":"android","sha":"e3475d4d7faae747a84805d6d1154baaba10ebb0","user":{"login":"birarda","id":724069,"avatar_url":"https://avatars.githubusercontent.com/u/724069?v=3","gravatar_id":"","url":"https://api.github.com/users/birarda","html_url":"https://github.com/birarda","followers_url":"https://api.github.com/users/birarda/followers","following_url":"https://api.github.com/users/birarda/following{/other_user}","gists_url":"https://api.github.com/users/birarda/gists{/gist_id}","starred_url":"https://api.github.com/users/birarda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/birarda/subscriptions","organizations_url":"https://api.github.com/users/birarda/orgs","repos_url":"https://api.github.com/users/birarda/repos","events_url":"https://api.github.com/users/birarda/events{/privacy}","received_events_url":"https://api.github.com/users/birarda/received_events","type":"User","site_admin":false},"repo":{"id":9376753,"name":"hifi","full_name":"birarda/hifi","owner":{"login":"birarda","id":724069,"avatar_url":"https://avatars.githubusercontent.com/u/724069?v=3","gravatar_id":"","url":"https://api.github.com/users/birarda","html_url":"https://github.com/birarda","followers_url":"https://api.github.com/users/birarda/followers","following_url":"https://api.github.com/users/birarda/following{/other_user}","gists_url":"https://api.github.com/users/birarda/gists{/gist_id}","starred_url":"https://api.github.com/users/birarda/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/birarda/subscriptions","organizations_url":"https://api.github.com/users/birarda/orgs","repos_url":"https://api.github.com/users/birarda/repos","events_url":"https://api.github.com/users/birarda/events{/privacy}","received_events_url":"https://api.github.com/users/birarda/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/birarda/hifi","description":"Test platform for various render and interface tests for next-gen VR system","fork":true,"url":"https://api.github.com/repos/birarda/hifi","forks_url":"https://api.github.com/repos/birarda/hifi/forks","keys_url":"https://api.github.com/repos/birarda/hifi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/birarda/hifi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/birarda/hifi/teams","hooks_url":"https://api.github.com/repos/birarda/hifi/hooks","issue_events_url":"https://api.github.com/repos/birarda/hifi/issues/events{/number}","events_url":"https://api.github.com/repos/birarda/hifi/events","assignees_url":"https://api.github.com/repos/birarda/hifi/assignees{/user}","branches_url":"https://api.github.com/repos/birarda/hifi/branches{/branch}","tags_url":"https://api.github.com/repos/birarda/hifi/tags","blobs_url":"https://api.github.com/repos/birarda/hifi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/birarda/hifi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/birarda/hifi/git/refs{/sha}","trees_url":"https://api.github.com/repos/birarda/hifi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/birarda/hifi/statuses/{sha}","languages_url":"https://api.github.com/repos/birarda/hifi/languages","stargazers_url":"https://api.github.com/repos/birarda/hifi/stargazers","contributors_url":"https://api.github.com/repos/birarda/hifi/contributors","subscribers_url":"https://api.github.com/repos/birarda/hifi/subscribers","subscription_url":"https://api.github.com/repos/birarda/hifi/subscription","commits_url":"https://api.github.com/repos/birarda/hifi/commits{/sha}","git_commits_url":"https://api.github.com/repos/birarda/hifi/git/commits{/sha}","comments_url":"https://api.github.com/repos/birarda/hifi/comments{/number}","issue_comment_url":"https://api.github.com/repos/birarda/hifi/issues/comments/{number}","contents_url":"https://api.github.com/repos/birarda/hifi/contents/{+path}","compare_url":"https://api.github.com/repos/birarda/hifi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/birarda/hifi/merges","archive_url":"https://api.github.com/repos/birarda/hifi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/birarda/hifi/downloads","issues_url":"https://api.github.com/repos/birarda/hifi/issues{/number}","pulls_url":"https://api.github.com/repos/birarda/hifi/pulls{/number}","milestones_url":"https://api.github.com/repos/birarda/hifi/milestones{/number}","notifications_url":"https://api.github.com/repos/birarda/hifi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/birarda/hifi/labels{/name}","releases_url":"https://api.github.com/repos/birarda/hifi/releases{/id}","created_at":"2013-04-11T17:58:46Z","updated_at":"2015-02-13T17:36:20Z","pushed_at":"2015-02-13T18:19:06Z","git_url":"git://github.com/birarda/hifi.git","ssh_url":"git@github.com:birarda/hifi.git","clone_url":"https://github.com/birarda/hifi.git","svn_url":"https://github.com/birarda/hifi","homepage":null,"size":152507,"stargazers_count":0,"watchers_count":0,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"highfidelity:master","ref":"master","sha":"d69efa03d89c40560fb42863cde5a26c74e79c2e","user":{"login":"highfidelity","id":1565370,"avatar_url":"https://avatars.githubusercontent.com/u/1565370?v=3","gravatar_id":"","url":"https://api.github.com/users/highfidelity","html_url":"https://github.com/highfidelity","followers_url":"https://api.github.com/users/highfidelity/followers","following_url":"https://api.github.com/users/highfidelity/following{/other_user}","gists_url":"https://api.github.com/users/highfidelity/gists{/gist_id}","starred_url":"https://api.github.com/users/highfidelity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/highfidelity/subscriptions","organizations_url":"https://api.github.com/users/highfidelity/orgs","repos_url":"https://api.github.com/users/highfidelity/repos","events_url":"https://api.github.com/users/highfidelity/events{/privacy}","received_events_url":"https://api.github.com/users/highfidelity/received_events","type":"Organization","site_admin":false},"repo":{"id":5372872,"name":"hifi","full_name":"highfidelity/hifi","owner":{"login":"highfidelity","id":1565370,"avatar_url":"https://avatars.githubusercontent.com/u/1565370?v=3","gravatar_id":"","url":"https://api.github.com/users/highfidelity","html_url":"https://github.com/highfidelity","followers_url":"https://api.github.com/users/highfidelity/followers","following_url":"https://api.github.com/users/highfidelity/following{/other_user}","gists_url":"https://api.github.com/users/highfidelity/gists{/gist_id}","starred_url":"https://api.github.com/users/highfidelity/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/highfidelity/subscriptions","organizations_url":"https://api.github.com/users/highfidelity/orgs","repos_url":"https://api.github.com/users/highfidelity/repos","events_url":"https://api.github.com/users/highfidelity/events{/privacy}","received_events_url":"https://api.github.com/users/highfidelity/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/highfidelity/hifi","description":"Open, decentralized virtual worlds using sensors to control avatars and dynamically assigned devices as servers.  San Francisco based startup, we are hiring: http://highfidelity.io/jobs  Documentation at http://docs.highfidelity.io  Contribute by reporting bugs & doing jobs on http://worklist.net","fork":false,"url":"https://api.github.com/repos/highfidelity/hifi","forks_url":"https://api.github.com/repos/highfidelity/hifi/forks","keys_url":"https://api.github.com/repos/highfidelity/hifi/keys{/key_id}","collaborators_url":"https://api.github.com/repos/highfidelity/hifi/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/highfidelity/hifi/teams","hooks_url":"https://api.github.com/repos/highfidelity/hifi/hooks","issue_events_url":"https://api.github.com/repos/highfidelity/hifi/issues/events{/number}","events_url":"https://api.github.com/repos/highfidelity/hifi/events","assignees_url":"https://api.github.com/repos/highfidelity/hifi/assignees{/user}","branches_url":"https://api.github.com/repos/highfidelity/hifi/branches{/branch}","tags_url":"https://api.github.com/repos/highfidelity/hifi/tags","blobs_url":"https://api.github.com/repos/highfidelity/hifi/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/highfidelity/hifi/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/highfidelity/hifi/git/refs{/sha}","trees_url":"https://api.github.com/repos/highfidelity/hifi/git/trees{/sha}","statuses_url":"https://api.github.com/repos/highfidelity/hifi/statuses/{sha}","languages_url":"https://api.github.com/repos/highfidelity/hifi/languages","stargazers_url":"https://api.github.com/repos/highfidelity/hifi/stargazers","contributors_url":"https://api.github.com/repos/highfidelity/hifi/contributors","subscribers_url":"https://api.github.com/repos/highfidelity/hifi/subscribers","subscription_url":"https://api.github.com/repos/highfidelity/hifi/subscription","commits_url":"https://api.github.com/repos/highfidelity/hifi/commits{/sha}","git_commits_url":"https://api.github.com/repos/highfidelity/hifi/git/commits{/sha}","comments_url":"https://api.github.com/repos/highfidelity/hifi/comments{/number}","issue_comment_url":"https://api.github.com/repos/highfidelity/hifi/issues/comments/{number}","contents_url":"https://api.github.com/repos/highfidelity/hifi/contents/{+path}","compare_url":"https://api.github.com/repos/highfidelity/hifi/compare/{base}...{head}","merges_url":"https://api.github.com/repos/highfidelity/hifi/merges","archive_url":"https://api.github.com/repos/highfidelity/hifi/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/highfidelity/hifi/downloads","issues_url":"https://api.github.com/repos/highfidelity/hifi/issues{/number}","pulls_url":"https://api.github.com/repos/highfidelity/hifi/pulls{/number}","milestones_url":"https://api.github.com/repos/highfidelity/hifi/milestones{/number}","notifications_url":"https://api.github.com/repos/highfidelity/hifi/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/highfidelity/hifi/labels{/name}","releases_url":"https://api.github.com/repos/highfidelity/hifi/releases{/id}","created_at":"2012-08-10T18:26:22Z","updated_at":"2015-02-13T18:50:11Z","pushed_at":"2015-02-13T18:50:11Z","git_url":"git://github.com/highfidelity/hifi.git","ssh_url":"git@github.com:highfidelity/hifi.git","clone_url":"https://github.com/highfidelity/hifi.git","svn_url":"https://github.com/highfidelity/hifi","homepage":"","size":192128,"stargazers_count":231,"watchers_count":231,"language":"C++","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":133,"mirror_url":null,"open_issues_count":49,"forks":133,"open_issues":49,"watchers":231,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/highfidelity/hifi/pulls/4279"},"html":{"href":"https://github.com/highfidelity/hifi/pull/4279"},"issue":{"href":"https://api.github.com/repos/highfidelity/hifi/issues/4279"},"comments":{"href":"https://api.github.com/repos/highfidelity/hifi/issues/4279/comments"},"review_comments":{"href":"https://api.github.com/repos/highfidelity/hifi/pulls/4279/comments"},"review_comment":{"href":"https://api.github.com/repos/highfidelity/hifi/pulls/comments/{number}"},"commits":{"href":"https://api.github.com/repos/highfidelity/hifi/pulls/4279/commits"},"statuses":{"href":"https://api.github.com/repos/highfidelity/hifi/statuses/e3475d4d7faae747a84805d6d1154baaba10ebb0"}}}}