Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1591)

Unified Diff: gpu/command_buffer/client/gles2_implementation.cc

Issue 11840002: Explicitly free shared memory buffers on GL client destruction. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add null-check Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | gpu/command_buffer/client/gles2_implementation_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: gpu/command_buffer/client/gles2_implementation.cc
diff --git a/gpu/command_buffer/client/gles2_implementation.cc b/gpu/command_buffer/client/gles2_implementation.cc
index e19911c81705b831b8e470ad5a0eb025afb46a0d..cdaad8262ae3487b9ea24842f84c554f58eca738 100644
--- a/gpu/command_buffer/client/gles2_implementation.cc
+++ b/gpu/command_buffer/client/gles2_implementation.cc
@@ -204,8 +204,8 @@ GLES2Implementation::~GLES2Implementation() {
// If it's destroyed it will use this GLES2Implemenation.
share_group_->SetGLES2ImplementationForDestruction(this);
share_group_ = NULL;
- // Make sure the commands make it the service.
- Finish();
+ // Finally, finish commands and free shared memory buffers.
+ FreeEverything();
}
GLES2CmdHelper* GLES2Implementation::helper() const {
@@ -250,7 +250,8 @@ void GLES2Implementation::FreeUnusedSharedMemory() {
void GLES2Implementation::FreeEverything() {
Finish();
- query_tracker_->Shrink();
+ if (query_tracker_.get())
+ query_tracker_->Shrink();
FreeUnusedSharedMemory();
transfer_buffer_->Free();
helper_->FreeRingBuffer();
« no previous file with comments | « no previous file | gpu/command_buffer/client/gles2_implementation_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698