Deleting program does not delete shaders that are marked
TRAC #12012
Resolve the crash on context deletion.
Signed-off-by: Nicolas Capens
Signed-off-by: Daniel Koch
Author: Andrew Lewycky
git-svn-id: https://angleproject.googlecode.com/svn/trunk@213 736b8ea6-26fd-11df-bfd4-992fa37f6226
diff --git a/src/libGLESv2/Shader.cpp b/src/libGLESv2/Shader.cpp
index 65799c4..1f3da76 100644
--- a/src/libGLESv2/Shader.cpp
+++ b/src/libGLESv2/Shader.cpp
@@ -21,7 +21,7 @@
void *Shader::mFragmentCompiler = NULL;
void *Shader::mVertexCompiler = NULL;
-Shader::Shader(GLuint handle) : mHandle(handle)
+Shader::Shader(Context *context, GLuint handle) : mHandle(handle), mContext(context)
{
mSource = NULL;
mHlsl = NULL;
@@ -188,7 +188,7 @@
if (mAttachCount == 0 && mDeleteStatus)
{
- getContext()->deleteShader(mHandle);
+ mContext->deleteShader(mHandle);
}
}
@@ -294,7 +294,7 @@
}
}
-VertexShader::VertexShader(GLuint handle) : Shader(handle)
+VertexShader::VertexShader(Context *context, GLuint handle) : Shader(context, handle)
{
}
@@ -368,7 +368,7 @@
}
}
-FragmentShader::FragmentShader(GLuint handle) : Shader(handle)
+FragmentShader::FragmentShader(Context *context, GLuint handle) : Shader(context, handle)
{
}