From 8e473760d7b495b06c600c5dc5e5fd42876e159f Mon Sep 17 00:00:00 2001 From: "edisonn@google.com" Date: Tue, 23 Jul 2013 19:45:38 +0000 Subject: [PATCH] If we fail to contruct the Pdf Image Shader, mark the object as busted, and dn't try to remove it from shaders list. Also, when we delete invalid shaders, remove the lock, otherwise we freeze (see CanonicalShadersMutex usage). R=vandebo@chromium.org Review URL: https://codereview.chromium.org/19509005 git-svn-id: http://skia.googlecode.com/svn/trunk@10290 2bbb7eff-a529-9590-31e7-b0007b416f81 --- src/pdf/SkPDFShader.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pdf/SkPDFShader.cpp b/src/pdf/SkPDFShader.cpp index a0dffb7791..8ffafb3c87 100644 --- a/src/pdf/SkPDFShader.cpp +++ b/src/pdf/SkPDFShader.cpp @@ -444,7 +444,9 @@ class SkPDFImageShader : public SkPDFStream, public SkPDFShader { public: explicit SkPDFImageShader(SkPDFShader::State* state); virtual ~SkPDFImageShader() { - RemoveShader(this); + if (isValid()) { + RemoveShader(this); + } fResources.unrefAll(); }