From 6127307998d9a22d4978612820a4d831c6cbffb9 Mon Sep 17 00:00:00 2001 From: Niklas Rosenstein Date: Wed, 12 Sep 2018 12:52:42 +0200 Subject: [PATCH] Fix #6 -- Crash on C4D exit in release build In webp.cpp, we used the C++ new operator to create the plugin objects, but we must use NewObjClear(). --- source/webpio.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/webpio.cpp b/source/webpio.cpp index e52f172..685acad 100644 --- a/source/webpio.cpp +++ b/source/webpio.cpp @@ -255,13 +255,13 @@ Bool RegisterWebpIO() { /* id */ ID_WEBP_BITMAP_LOADER, /* name */ "WebP"_s, /* info */ 0, - /* data */ new WebPBitmapImporter); + /* data */ NewObjClear(WebPBitmapImporter)); RegisterBitmapSaverPlugin( /* id */ ID_WEBP_BITMAP_SAVER, /* name */ "WebP"_s, /* info */ PLUGINFLAG_BITMAPSAVER_SUPPORT_8BIT | PLUGINFLAG_BITMAPSAVER_FORCESUFFIX, - /* data */ new WebPBitmapExporter, + /* data */ NewObjClear(WebPBitmapExporter), /* suffix */ "webp"_s); return true;