Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1289)

Unified Diff: third_party/WebKit/Source/core/css/CSSPathValue.cpp

Issue 1566423002: Avoid LSan false positives from CSSPathValue::emptyValue(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase and adjust to RefPtr<> Created 4 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/CSSPathValue.cpp
diff --git a/third_party/WebKit/Source/core/css/CSSPathValue.cpp b/third_party/WebKit/Source/core/css/CSSPathValue.cpp
index f725d430de82061109b0da6000ed1000a95e6bfe..dcfbf15a0ef0ea179d3552dc8fb3d642e4e14082 100644
--- a/third_party/WebKit/Source/core/css/CSSPathValue.cpp
+++ b/third_party/WebKit/Source/core/css/CSSPathValue.cpp
@@ -33,9 +33,22 @@ CSSPathValue::~CSSPathValue()
{
}
+namespace {
+
+PassRefPtrWillBeRawPtr<CSSPathValue> createPathValue()
+{
+ RefPtr<SVGPathByteStream> pathByteStream = SVGPathByteStream::create();
+ // Need to be registered as LSan ignored, as it will be reachable and
+ // separately referred to by emptyPathValue() callers.
+ LEAK_SANITIZER_IGNORE_OBJECT(pathByteStream.get());
+ return CSSPathValue::create(pathByteStream.release());
+}
+
+}
+
CSSPathValue* CSSPathValue::emptyPathValue()
{
- DEFINE_STATIC_LOCAL(RefPtrWillBePersistent<CSSPathValue>, empty, (CSSPathValue::create(SVGPathByteStream::create())));
+ DEFINE_STATIC_LOCAL(RefPtrWillBePersistent<CSSPathValue>, empty, (createPathValue()));
return empty.get();
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698