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 e7118e8736a9b0c9702b79a9388f597a6845b6aa..51c63707421276e368442b4ba22fe6761b64bf9c 100644 |
--- a/gpu/command_buffer/client/gles2_implementation.cc |
+++ b/gpu/command_buffer/client/gles2_implementation.cc |
@@ -210,8 +210,11 @@ GLES2Implementation::~GLES2Implementation() { |
WaitForCmd(); |
query_tracker_.reset(); |
- if (support_client_side_arrays_) |
+ // GLES2Implementation::Initialize() could fail before allocating |
+ // reserved_ids_, so we need delete them carefully. |
+ if (support_client_side_arrays_ && reserved_ids_[0]) { |
DeleteBuffers(arraysize(reserved_ids_), &reserved_ids_[0]); |
+ } |
// Release any per-context data in share group. |
share_group_->FreeContext(this); |