Handle case createShader throws an exception.
Ensures the state of the class remains correct even if an unhandled exception is thrown from this method. Bug: b/176214704 Change-Id: I94504bb8aa4bd2dba45d116d5fa13da070a3b60f Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/201621 Reviewed-by: Xavier Lepaul <xalep@webrtc.org> Commit-Queue: Sami Kalliomäki <sakal@webrtc.org> Cr-Commit-Position: refs/heads/master@{#32963}
This commit is contained in:
committed by
Commit Bot
parent
94324f2774
commit
6e509f9167
@ -219,11 +219,14 @@ class GlGenericDrawer implements RendererCommon.GlDrawer {
|
|||||||
shader = currentShader;
|
shader = currentShader;
|
||||||
} else {
|
} else {
|
||||||
// Allocate new shader.
|
// Allocate new shader.
|
||||||
currentShaderType = shaderType;
|
currentShaderType = null;
|
||||||
if (currentShader != null) {
|
if (currentShader != null) {
|
||||||
currentShader.release();
|
currentShader.release();
|
||||||
|
currentShader = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
shader = createShader(shaderType);
|
shader = createShader(shaderType);
|
||||||
|
currentShaderType = shaderType;
|
||||||
currentShader = shader;
|
currentShader = shader;
|
||||||
|
|
||||||
shader.useProgram();
|
shader.useProgram();
|
||||||
|
|||||||
Reference in New Issue
Block a user