Fixed SkVertices crashing on Windows DLL builds
SkVertices::Builder uses custom new operator but not exposed to dll.
While delete operator in SkVertices.h could be inlined, it causes crash on Windows DLL builds. This patch fixes this issue.
Change-Id: I8b635ad3aa4a3f496a392ce7840417947999e4b0
Reviewed-on: https://skia-review.googlesource.com/122480
Commit-Queue: Mike Klein <mtklein@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
diff --git a/AUTHORS b/AUTHORS
index 0d33ce1..016e05a 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -49,4 +49,5 @@
Marco Alesiani <marco.diiga@gmail.com>
Adobe Systems Incorporated <*@adobe.com>
Yandex LLC <*@yandex-team.ru>
-Kaloyan Donev <kdonev@gmail.com>
\ No newline at end of file
+Kaloyan Donev <kdonev@gmail.com>
+Yong-Hwan Baek <meisterdevhwan@gmail.com>
diff --git a/include/core/SkVertices.h b/include/core/SkVertices.h
index db1764e..9224eeb 100644
--- a/include/core/SkVertices.h
+++ b/include/core/SkVertices.h
@@ -115,7 +115,7 @@
// these are needed since we've manually sized our allocation (see Builder::init)
friend class SkNVRefCnt<SkVertices>;
- void operator delete(void* p) { ::operator delete(p); }
+ void operator delete(void* p);
static sk_sp<SkVertices> Alloc(int vCount, int iCount, uint32_t builderFlags,
size_t* arraySize);
diff --git a/src/core/SkVertices.cpp b/src/core/SkVertices.cpp
index 7253109..900247d 100644
--- a/src/core/SkVertices.cpp
+++ b/src/core/SkVertices.cpp
@@ -235,3 +235,8 @@
}
return builder.detach();
}
+
+void SkVertices::operator delete(void* p)
+{
+ ::operator delete(p);
+}