comparison 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
comparison
equal deleted inserted replaced
380:cb91096fef06 381:9cde77ca9ad9
24 #include "../../Framework/Plugins/PluginInitialization.h" 24 #include "../../Framework/Plugins/PluginInitialization.h"
25 25
26 #include <Logging.h> 26 #include <Logging.h>
27 #include <Toolbox.h> 27 #include <Toolbox.h>
28 28
29 #include <google/protobuf/any.h>
30
29 31
30 extern "C" 32 extern "C"
31 { 33 {
32 ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* context) 34 ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* context)
33 { 35 {
36 GOOGLE_PROTOBUF_VERIFY_VERSION;
37
34 if (!OrthancDatabases::InitializePlugin(context, "PostgreSQL", true)) 38 if (!OrthancDatabases::InitializePlugin(context, "PostgreSQL", true))
35 { 39 {
36 return -1; 40 return -1;
37 } 41 }
38 42
85 ORTHANC_PLUGINS_API void OrthancPluginFinalize() 89 ORTHANC_PLUGINS_API void OrthancPluginFinalize()
86 { 90 {
87 LOG(WARNING) << "PostgreSQL index is finalizing"; 91 LOG(WARNING) << "PostgreSQL index is finalizing";
88 OrthancDatabases::IndexBackend::Finalize(); 92 OrthancDatabases::IndexBackend::Finalize();
89 Orthanc::Toolbox::FinalizeOpenSsl(); 93 Orthanc::Toolbox::FinalizeOpenSsl();
94 google::protobuf::ShutdownProtobufLibrary();
90 } 95 }
91 96
92 97
93 ORTHANC_PLUGINS_API const char* OrthancPluginGetName() 98 ORTHANC_PLUGINS_API const char* OrthancPluginGetName()
94 { 99 {