summaryrefslogtreecommitdiffstats
path: root/WebCore/html/canvas/WebGLProgram.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/html/canvas/WebGLProgram.cpp')
-rw-r--r--WebCore/html/canvas/WebGLProgram.cpp13
1 files changed, 9 insertions, 4 deletions
diff --git a/WebCore/html/canvas/WebGLProgram.cpp b/WebCore/html/canvas/WebGLProgram.cpp
index 8cf3c42..0853b67 100644
--- a/WebCore/html/canvas/WebGLProgram.cpp
+++ b/WebCore/html/canvas/WebGLProgram.cpp
@@ -47,12 +47,17 @@ WebGLProgram::WebGLProgram(WebGLRenderingContext* ctx)
void WebGLProgram::deleteObjectImpl(Platform3DObject obj)
{
- context()->graphicsContext3D()->deleteProgram(obj);
- if (!object()) {
- if (m_vertexShader)
+ if (!isDeleted())
+ context()->graphicsContext3D()->deleteProgram(obj);
+ if (!getAttachmentCount()) {
+ if (m_vertexShader) {
m_vertexShader->onDetached();
- if (m_fragmentShader)
+ m_vertexShader = 0;
+ }
+ if (m_fragmentShader) {
m_fragmentShader->onDetached();
+ m_fragmentShader = 0;
+ }
}
}