{"action":"created","comment":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/comments/64774435","id":64774435,"diff_hunk":"@@ -6,77 +6,76 @@ namespace mbgl {\n namespace gl {\n \n void ProgramHolder::create(GLObjectStore& objectStore_) {\n-    if (id) return;\n+    if (created()) return;\n     objectStore = &objectStore_;\n     id = MBGL_CHECK_ERROR(glCreateProgram());\n }\n \n void ProgramHolder::reset() {\n-    if (!id) return;\n+    if (!created()) return;\n     objectStore->abandonedPrograms.push_back(id);\n     id = 0;\n }\n \n void ShaderHolder::create(GLObjectStore& objectStore_) {\n-    if (id) return;\n+    if (created()) return;\n     objectStore = &objectStore_;\n     id = MBGL_CHECK_ERROR(glCreateShader(type));\n }\n \n void ShaderHolder::reset() {\n-    if (!id) return;\n+    if (!created()) return;\n     objectStore->abandonedShaders.push_back(id);\n     id = 0;\n }\n \n void BufferHolder::create(GLObjectStore& objectStore_) {\n-    if (id) return;\n+    if (created()) return;\n     objectStore = &objectStore_;\n     MBGL_CHECK_ERROR(glGenBuffers(1, &id));\n }\n \n void BufferHolder::reset() {\n-    if (!id) return;\n+    if (!created()) return;\n     objectStore->abandonedBuffers.push_back(id);\n     id = 0;\n }\n \n void TextureHolder::create(GLObjectStore& objectStore_) {\n-    if (id) return;\n+    if (created()) return;\n     objectStore = &objectStore_;\n     MBGL_CHECK_ERROR(glGenTextures(1, &id));\n }\n \n void TextureHolder::reset() {\n-    if (!id) return;\n+    if (!created()) return;\n     objectStore->abandonedTextures.push_back(id);\n     id = 0;\n }\n \n void TexturePoolHolder::create(GLObjectStore& objectStore_) {\n-    if (bool()) return;\n+    if (created()) return;\n     objectStore = &objectStore_;\n     MBGL_CHECK_ERROR(glGenTextures(TextureMax, ids.data()));\n }\n \n void TexturePoolHolder::reset() {\n-    if (!bool()) return;\n-    for (GLuint id : ids) {\n-        if (id) {\n-            objectStore->abandonedTextures.push_back(id);\n-        }\n-    }\n-    ids.fill(0);\n+    if (!created()) return;\n+    for (GLuint& id : ids) {\n+        if (id == 0) return;","path":"src/mbgl/gl/gl_object_store.cpp","position":76,"original_position":76,"commit_id":"b9351dd0a9c138ba95cb6bf847e0a6e42b67028f","original_commit_id":"b9351dd0a9c138ba95cb6bf847e0a6e42b67028f","user":{"login":"brunoabinader","id":76133,"avatar_url":"https://avatars.githubusercontent.com/u/76133?v=3","gravatar_id":"","url":"https://api.github.com/users/brunoabinader","html_url":"https://github.com/brunoabinader","followers_url":"https://api.github.com/users/brunoabinader/followers","following_url":"https://api.github.com/users/brunoabinader/following{/other_user}","gists_url":"https://api.github.com/users/brunoabinader/gists{/gist_id}","starred_url":"https://api.github.com/users/brunoabinader/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brunoabinader/subscriptions","organizations_url":"https://api.github.com/users/brunoabinader/orgs","repos_url":"https://api.github.com/users/brunoabinader/repos","events_url":"https://api.github.com/users/brunoabinader/events{/privacy}","received_events_url":"https://api.github.com/users/brunoabinader/received_events","type":"User","site_admin":false},"body":"Ah yes, meant `continue` there.","created_at":"2016-05-26T16:12:43Z","updated_at":"2016-05-26T16:12:43Z","html_url":"https://github.com/mapbox/mapbox-gl-native/pull/5141#discussion_r64774435","pull_request_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/5141","_links":{"self":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/comments/64774435"},"html":{"href":"https://github.com/mapbox/mapbox-gl-native/pull/5141#discussion_r64774435"},"pull_request":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/5141"}}},"pull_request":{"url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/5141","id":71463430,"html_url":"https://github.com/mapbox/mapbox-gl-native/pull/5141","diff_url":"https://github.com/mapbox/mapbox-gl-native/pull/5141.diff","patch_url":"https://github.com/mapbox/mapbox-gl-native/pull/5141.patch","issue_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/5141","number":5141,"state":"open","locked":false,"title":"Fix texture leak in TexturePoolHolder","user":{"login":"brunoabinader","id":76133,"avatar_url":"https://avatars.githubusercontent.com/u/76133?v=3","gravatar_id":"","url":"https://api.github.com/users/brunoabinader","html_url":"https://github.com/brunoabinader","followers_url":"https://api.github.com/users/brunoabinader/followers","following_url":"https://api.github.com/users/brunoabinader/following{/other_user}","gists_url":"https://api.github.com/users/brunoabinader/gists{/gist_id}","starred_url":"https://api.github.com/users/brunoabinader/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/brunoabinader/subscriptions","organizations_url":"https://api.github.com/users/brunoabinader/orgs","repos_url":"https://api.github.com/users/brunoabinader/repos","events_url":"https://api.github.com/users/brunoabinader/events{/privacy}","received_events_url":"https://api.github.com/users/brunoabinader/received_events","type":"User","site_admin":false},"body":"Fixes a misused `operator bool()` plus usage of an undefined pointer in `{GL,TexturePool}Holder` code.\r\n\r\n:eyes: @kkaefer @jfirebaugh \r\n\r\nFixes #5136.","created_at":"2016-05-25T21:08:33Z","updated_at":"2016-05-26T16:12:43Z","closed_at":null,"merged_at":null,"merge_commit_sha":"4ea2bf4a20898a7bd87c93ebb9da4e4ee7d5f639","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/5141/commits","review_comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/5141/comments","review_comment_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/comments{/number}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/5141/comments","statuses_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/statuses/b9351dd0a9c138ba95cb6bf847e0a6e42b67028f","head":{"label":"mapbox:brunoabinader-texture-leak","ref":"brunoabinader-texture-leak","sha":"b9351dd0a9c138ba95cb6bf847e0a6e42b67028f","user":{"login":"mapbox","id":600935,"avatar_url":"https://avatars.githubusercontent.com/u/600935?v=3","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"repo":{"id":16286131,"name":"mapbox-gl-native","full_name":"mapbox/mapbox-gl-native","owner":{"login":"mapbox","id":600935,"avatar_url":"https://avatars.githubusercontent.com/u/600935?v=3","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapbox/mapbox-gl-native","description":"Render Mapbox styles in mobile, desktop, and node applications using C++ and OpenGL","fork":false,"url":"https://api.github.com/repos/mapbox/mapbox-gl-native","forks_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/forks","keys_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/teams","hooks_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/hooks","issue_events_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/events{/number}","events_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/events","assignees_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/assignees{/user}","branches_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/branches{/branch}","tags_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/tags","blobs_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/statuses/{sha}","languages_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/languages","stargazers_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/stargazers","contributors_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/contributors","subscribers_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/subscribers","subscription_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/subscription","commits_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/contents/{+path}","compare_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/merges","archive_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/downloads","issues_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues{/number}","pulls_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls{/number}","milestones_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/milestones{/number}","notifications_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels{/name}","releases_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/releases{/id}","deployments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/deployments","created_at":"2014-01-27T17:14:48Z","updated_at":"2016-05-26T12:00:37Z","pushed_at":"2016-05-26T16:08:45Z","git_url":"git://github.com/mapbox/mapbox-gl-native.git","ssh_url":"git@github.com:mapbox/mapbox-gl-native.git","clone_url":"https://github.com/mapbox/mapbox-gl-native.git","svn_url":"https://github.com/mapbox/mapbox-gl-native","homepage":"https://mapbox.com/mobile","size":102140,"stargazers_count":1278,"watchers_count":1278,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":340,"mirror_url":null,"open_issues_count":490,"forks":340,"open_issues":490,"watchers":1278,"default_branch":"master"}},"base":{"label":"mapbox:master","ref":"master","sha":"26a425fa6d0386aa59027b1b5813edd781f460ed","user":{"login":"mapbox","id":600935,"avatar_url":"https://avatars.githubusercontent.com/u/600935?v=3","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"repo":{"id":16286131,"name":"mapbox-gl-native","full_name":"mapbox/mapbox-gl-native","owner":{"login":"mapbox","id":600935,"avatar_url":"https://avatars.githubusercontent.com/u/600935?v=3","gravatar_id":"","url":"https://api.github.com/users/mapbox","html_url":"https://github.com/mapbox","followers_url":"https://api.github.com/users/mapbox/followers","following_url":"https://api.github.com/users/mapbox/following{/other_user}","gists_url":"https://api.github.com/users/mapbox/gists{/gist_id}","starred_url":"https://api.github.com/users/mapbox/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mapbox/subscriptions","organizations_url":"https://api.github.com/users/mapbox/orgs","repos_url":"https://api.github.com/users/mapbox/repos","events_url":"https://api.github.com/users/mapbox/events{/privacy}","received_events_url":"https://api.github.com/users/mapbox/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/mapbox/mapbox-gl-native","description":"Render Mapbox styles in mobile, desktop, and node applications using C++ and OpenGL","fork":false,"url":"https://api.github.com/repos/mapbox/mapbox-gl-native","forks_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/forks","keys_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/keys{/key_id}","collaborators_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/teams","hooks_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/hooks","issue_events_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/events{/number}","events_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/events","assignees_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/assignees{/user}","branches_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/branches{/branch}","tags_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/tags","blobs_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/refs{/sha}","trees_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/trees{/sha}","statuses_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/statuses/{sha}","languages_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/languages","stargazers_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/stargazers","contributors_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/contributors","subscribers_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/subscribers","subscription_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/subscription","commits_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/commits{/sha}","git_commits_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/git/commits{/sha}","comments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/comments{/number}","issue_comment_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/comments{/number}","contents_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/contents/{+path}","compare_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/compare/{base}...{head}","merges_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/merges","archive_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/downloads","issues_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues{/number}","pulls_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls{/number}","milestones_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/milestones{/number}","notifications_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/labels{/name}","releases_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/releases{/id}","deployments_url":"https://api.github.com/repos/mapbox/mapbox-gl-native/deployments","created_at":"2014-01-27T17:14:48Z","updated_at":"2016-05-26T12:00:37Z","pushed_at":"2016-05-26T16:08:45Z","git_url":"git://github.com/mapbox/mapbox-gl-native.git","ssh_url":"git@github.com:mapbox/mapbox-gl-native.git","clone_url":"https://github.com/mapbox/mapbox-gl-native.git","svn_url":"https://github.com/mapbox/mapbox-gl-native","homepage":"https://mapbox.com/mobile","size":102140,"stargazers_count":1278,"watchers_count":1278,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":340,"mirror_url":null,"open_issues_count":490,"forks":340,"open_issues":490,"watchers":1278,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/5141"},"html":{"href":"https://github.com/mapbox/mapbox-gl-native/pull/5141"},"issue":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/5141"},"comments":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/issues/5141/comments"},"review_comments":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/5141/comments"},"review_comment":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/pulls/5141/commits"},"statuses":{"href":"https://api.github.com/repos/mapbox/mapbox-gl-native/statuses/b9351dd0a9c138ba95cb6bf847e0a6e42b67028f"}}}}
{"actor":{"display_login":"brunoabinader"}}