# HG changeset patch # User Sebastien Jodogne # Date 1680203817 -7200 # Node ID 9cde77ca9ad93371112204c040bcc9289d650fb7 # Parent cb91096fef06a6cc6e2d1c95f4adf733ec8c5c97 initializing and finalizing protobuf diff -r cb91096fef06 -r 9cde77ca9ad9 Framework/Plugins/IndexBackend.cpp --- a/Framework/Plugins/IndexBackend.cpp Thu Mar 30 17:08:00 2023 +0200 +++ b/Framework/Plugins/IndexBackend.cpp Thu Mar 30 21:16:57 2023 +0200 @@ -2692,6 +2692,12 @@ OrthancDatabases::DatabaseBackendAdapterV3::Finalize(); # endif #endif + +#if defined(ORTHANC_PLUGINS_VERSION_IS_ABOVE) // Macro introduced in Orthanc 1.3.1 +# if ORTHANC_PLUGINS_VERSION_IS_ABOVE(1, 12, 0) + OrthancDatabases::DatabaseBackendAdapterV4::Finalize(); +# endif +#endif } diff -r cb91096fef06 -r 9cde77ca9ad9 MySQL/Plugins/IndexPlugin.cpp --- a/MySQL/Plugins/IndexPlugin.cpp Thu Mar 30 17:08:00 2023 +0200 +++ b/MySQL/Plugins/IndexPlugin.cpp Thu Mar 30 21:16:57 2023 +0200 @@ -28,11 +28,15 @@ #include #include +#include + extern "C" { ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* context) { + GOOGLE_PROTOBUF_VERIFY_VERSION; + if (!OrthancDatabases::InitializePlugin(context, "MySQL", true)) { return -1; @@ -93,6 +97,7 @@ OrthancDatabases::MySQLDatabase::GlobalFinalization(); Orthanc::HttpClient::GlobalFinalize(); Orthanc::Toolbox::FinalizeOpenSsl(); + google::protobuf::ShutdownProtobufLibrary(); } diff -r cb91096fef06 -r 9cde77ca9ad9 PostgreSQL/Plugins/IndexPlugin.cpp --- 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 #include +#include + 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(); } diff -r cb91096fef06 -r 9cde77ca9ad9 SQLite/Plugins/IndexPlugin.cpp --- a/SQLite/Plugins/IndexPlugin.cpp Thu Mar 30 17:08:00 2023 +0200 +++ b/SQLite/Plugins/IndexPlugin.cpp Thu Mar 30 21:16:57 2023 +0200 @@ -25,11 +25,15 @@ #include +#include + extern "C" { ORTHANC_PLUGINS_API int32_t OrthancPluginInitialize(OrthancPluginContext* context) { + GOOGLE_PROTOBUF_VERIFY_VERSION; + if (!OrthancDatabases::InitializePlugin(context, "SQLite", true)) { return -1; @@ -84,6 +88,7 @@ { LOG(WARNING) << "SQLite index is finalizing"; OrthancDatabases::IndexBackend::Finalize(); + google::protobuf::ShutdownProtobufLibrary(); }