]> git.ipfire.org Git - thirdparty/pdns.git/commitdiff
Cleanup some global resources.
authorOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 11 Nov 2019 13:19:41 +0000 (13:19 +0000)
committerOtto Moerbeek <otto.moerbeek@open-xchange.com>
Mon, 11 Nov 2019 13:19:41 +0000 (13:19 +0000)
With this (on a short run):

==13452== HEAP SUMMARY:
==13452==     in use at exit: 0 bytes in 0 blocks
==13452==   total heap usage: 54,657 allocs, 54,657 frees, 14,008,997 bytes allocated

pdns/pdns_recursor.cc

index c6200a1e5f674d29c2abd1c2e24353f3ffc7f8c4..116e0d67235d804d4025fdc00dffaa96cfcd438d 100644 (file)
@@ -4319,6 +4319,10 @@ static int serviceMain(int argc, char*argv[])
       ti.thread.join();
     }
   }
+
+#ifdef HAVE_PROTOBUF
+  google::protobuf::ShutdownProtobufLibrary();
+#endif /* HAVE_PROTOBUF */
   return 0;
 }
 
@@ -4403,11 +4407,13 @@ try
 
   t_fdm=getMultiplexer();
 
+  RecursorWebServer *rws = nullptr;
+  
   if(threadInfo.isHandler) {
     if(::arg().mustDo("webserver")) {
       g_log<<Logger::Warning << "Enabling web server" << endl;
       try {
-        new RecursorWebServer(t_fdm);
+        rws = new RecursorWebServer(t_fdm);
       }
       catch(PDNSException &e) {
         g_log<<Logger::Error<<"Exception: "<<e.reason<<endl;
@@ -4521,6 +4527,8 @@ try
       }
     }
   }
+  delete rws;
+  delete t_fdm;
   return 0;
 }
 catch(PDNSException &ae) {