Index: Source/core/html/canvas/WebGLContextGroup.cpp |
diff --git a/Source/core/html/canvas/WebGLContextGroup.cpp b/Source/core/html/canvas/WebGLContextGroup.cpp |
index 46650a6e29205de66c7c84e4b19e1d67f846b9a2..8a6c463fe07bfdf3e84b545f932515767148d247 100644 |
--- a/Source/core/html/canvas/WebGLContextGroup.cpp |
+++ b/Source/core/html/canvas/WebGLContextGroup.cpp |
@@ -61,6 +61,12 @@ void WebGLContextGroup::addContext(WebGLRenderingContext* context) |
void WebGLContextGroup::removeContext(WebGLRenderingContext* context) |
{ |
+ // Release all the resources this context has acquired. |
+ for (HashSet<WebGLSharedObject*>::iterator it = m_groupObjects.begin(); it != m_groupObjects.end(); ++it) { |
+ (*it)->release(context); |
+ (*it)->cancelAllPendingRequestsForContext(context); |
+ } |
+ |
// We must call detachAndRemoveAllObjects before removing the last context. |
if (m_contexts.size() == 1 && m_contexts.contains(context)) |
detachAndRemoveAllObjects(); |
@@ -96,4 +102,13 @@ void WebGLContextGroup::loseContextGroup(WebGLRenderingContext::LostContextMode |
(*it)->loseContextImpl(mode); |
} |
+void WebGLContextGroup::cancelAcquireSharedResource(const WebGLRenderingContext* context, long id) |
+{ |
+ for (HashSet<WebGLSharedObject*>::iterator it = m_groupObjects.begin(); it != m_groupObjects.end(); ++it) { |
+ if ((*it)->cancelAcquireRequest(context, id)) { |
+ break; |
+ } |
+ } |
+} |
+ |
} // namespace WebCore |