diff PostgreSQL/Plugins/IndexPlugin.cpp @ 381:9cde77ca9ad9 db-protobuf

initializing and finalizing protobuf
author Sebastien Jodogne <s.jodogne@gmail.com>
date Thu, 30 Mar 2023 21:16:57 +0200
parents 16aac0287485
children 3d6886f3e5b3
line wrap: on
line diff
--- a/PostgreSQL/Plugins/IndexPlugin.cpp	Thu Mar 30 17:08:00 2023 +0200
+++ b/PostgreSQL/Plugins/IndexPlugin.cpp	Thu Mar 30 21:16:57 2023 +0200
@@ -26,11 +26,15 @@
 #include <Logging.h>
 #include <Toolbox.h>
 
+#include <google/protobuf/any.h>
+
 
 extern "C"
 {
   ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* context)
   {
+    GOOGLE_PROTOBUF_VERIFY_VERSION;
+
     if (!OrthancDatabases::InitializePlugin(context, "PostgreSQL", true))
     {
       return -1;
@@ -87,6 +91,7 @@
     LOG(WARNING) << "PostgreSQL index is finalizing";
     OrthancDatabases::IndexBackend::Finalize();
     Orthanc::Toolbox::FinalizeOpenSsl();
+    google::protobuf::ShutdownProtobufLibrary();
   }