comparison SQLite/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
23 #include "SQLiteIndex.h" 23 #include "SQLiteIndex.h"
24 #include "../../Framework/Plugins/PluginInitialization.h" 24 #include "../../Framework/Plugins/PluginInitialization.h"
25 25
26 #include <Logging.h> 26 #include <Logging.h>
27 27
28 #include <google/protobuf/any.h>
29
28 30
29 extern "C" 31 extern "C"
30 { 32 {
31 ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* context) 33 ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* context)
32 { 34 {
35 GOOGLE_PROTOBUF_VERIFY_VERSION;
36
33 if (!OrthancDatabases::InitializePlugin(context, "SQLite", true)) 37 if (!OrthancDatabases::InitializePlugin(context, "SQLite", true))
34 { 38 {
35 return -1; 39 return -1;
36 } 40 }
37 41
82 86
83 ORTHANC_PLUGINS_API void OrthancPluginFinalize() 87 ORTHANC_PLUGINS_API void OrthancPluginFinalize()
84 { 88 {
85 LOG(WARNING) << "SQLite index is finalizing"; 89 LOG(WARNING) << "SQLite index is finalizing";
86 OrthancDatabases::IndexBackend::Finalize(); 90 OrthancDatabases::IndexBackend::Finalize();
91 google::protobuf::ShutdownProtobufLibrary();
87 } 92 }
88 93
89 94
90 ORTHANC_PLUGINS_API const char* OrthancPluginGetName() 95 ORTHANC_PLUGINS_API const char* OrthancPluginGetName()
91 { 96 {