diff options
author | Adrienne Walker <enne@chromium.org> | 2017-08-22 13:54:29 -0700 |
---|---|---|
committer | Skia Commit-Bot <skia-commit-bot@chromium.org> | 2017-08-22 21:13:07 +0000 |
commit | d6b28f7bc8c84ee952c433d54861620e403b990f (patch) | |
tree | 2bde8182bd25bc2a3d3ab957eb8821beb3dc3a19 /src/core/SkPathRef.cpp | |
parent | 407b34235750d95dfc13260ff434d6be29eab264 (diff) |
Don't validate() in ~SkPathRef
If an SkPathRef is constructed from arbitrary memory, it might not be
valid. However, any SkPathRef should be able to be destroyed cleanly.
An alternative to this would be to have CreateFromBuffer always do
the validation (even in release builds), return null for invalid ones,
and do the cleanup itself, but this seems like extra complication and
maybe not something general release builds want.
Bug: chromium: 752755
Change-Id: I1d509a5d5d0b173c20162ff79d731d6c8b4b6fb4
Reviewed-on: https://skia-review.googlesource.com/37321
Commit-Queue: Adrienne Walker <enne@chromium.org>
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@google.com>
Diffstat (limited to 'src/core/SkPathRef.cpp')
-rw-r--r-- | src/core/SkPathRef.cpp | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/core/SkPathRef.cpp b/src/core/SkPathRef.cpp index 021733c5fa..5894b0522b 100644 --- a/src/core/SkPathRef.cpp +++ b/src/core/SkPathRef.cpp @@ -33,8 +33,9 @@ SkPathRef::Editor::Editor(sk_sp<SkPathRef>* pathRef, ////////////////////////////////////////////////////////////////////////////// SkPathRef::~SkPathRef() { + // Deliberately don't validate() this path ref, otherwise there's no way + // to read one that's not valid and then free its memory without asserting. this->callGenIDChangeListeners(); - SkDEBUGCODE(this->validate();) sk_free(fPoints); SkDEBUGCODE(fPoints = nullptr;) |