This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/master by this push:
     new bd1dc37  This hides the memory leak that CA otherwise finds
bd1dc37 is described below

commit bd1dc373f6e581a2bf728d2fafc10f315fcc6cd8
Author: Leif Hedstrom <zw...@apache.org>
AuthorDate: Mon Nov 5 13:21:52 2018 -0700

    This hides the memory leak that CA otherwise finds
---
 plugins/experimental/magick/magick.cc                 | 7 ++++++-
 plugins/experimental/webp_transform/ImageTransform.cc | 7 ++++++-
 2 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/plugins/experimental/magick/magick.cc 
b/plugins/experimental/magick/magick.cc
index 833c34c..b4f3cb0 100644
--- a/plugins/experimental/magick/magick.cc
+++ b/plugins/experimental/magick/magick.cc
@@ -56,6 +56,11 @@ using StringViewVector  = std::vector<std::string_view>;
 
 using byte = unsigned char;
 
+namespace
+{
+GlobalPlugin *plugin;
+}
+
 struct ThreadPool {
   using Callback = std::function<void(void)>;
   using Queue    = std::list<Callback>;
@@ -621,5 +626,5 @@ TSPluginInit(int argc, const char **argv)
     key = argv[1];
   }
 
-  new GlobalHookPlugin(key);
+  plugin = new GlobalHookPlugin(key);
 }
diff --git a/plugins/experimental/webp_transform/ImageTransform.cc 
b/plugins/experimental/webp_transform/ImageTransform.cc
index 8c7a1b0..68ea938 100644
--- a/plugins/experimental/webp_transform/ImageTransform.cc
+++ b/plugins/experimental/webp_transform/ImageTransform.cc
@@ -32,6 +32,11 @@ using namespace atscppapi;
 
 #define TAG "webp_transform"
 
+namespace
+{
+GlobalPlugin *plugin;
+}
+
 class ImageTransform : public TransformationPlugin
 {
 public:
@@ -103,5 +108,5 @@ TSPluginInit(int argc ATSCPPAPI_UNUSED, const char *argv[] 
ATSCPPAPI_UNUSED)
     return;
   }
   InitializeMagick("");
-  new GlobalHookPlugin();
+  plugin = new GlobalHookPlugin();
 }

Reply via email to