Update
CI / GCC 16 / C++26 / default (push) Has been cancelled
CI / GCC 16 / C++26 / sanitizers (push) Has been cancelled
CI / GCC 16 / C++26 / werror (push) Has been cancelled

Signed-off-by: faumaray <faumaray@gmail.com>
This commit is contained in:
faumaray committed 2026-07-12 03:00:38 +03:00
1 parent 4fca5523f6
commit fa30098129
5 files changed
+59

No files matched your search

+4
View File
@@ -243,9 +243,13 @@ std::expected<void, LoadError> PluginLoader::reload()
try {
next.plugin_->on_load();
} catch (...) {
std::error_code ec;
std::filesystem::remove(tmp, ec);
return std::unexpected{LoadError::ActivationFailed};
}
if (next.ready_ && next.ready_(next.plugin_) != 0) {
std::error_code ec;
std::filesystem::remove(tmp, ec);
return std::unexpected{LoadError::ActivationFailed};
}
+10
View File
@@ -255,6 +255,10 @@ namespace Void::Plugin
(*inst)->ready((*inst)->plugin) != 0) {
return std::unexpected{LoadError::ActivationFailed};
}
if (m_options.instance_validator &&
!m_options.instance_validator(*(*inst)->plugin, (*inst)->info)) {
return std::unexpected{LoadError::ActivationFailed};
}
std::lock_guard lock(m_mutex);
auto entry = std::make_unique<Entry>();
@@ -394,6 +398,12 @@ namespace Void::Plugin
"reload '{}' aborted: activation failed", name);
return std::unexpected{LoadError::ActivationFailed};
}
if (m_options.instance_validator &&
!m_options.instance_validator(*(*next)->plugin, (*next)->info)) {
Void::Log::warn("Plugin.Manager",
"reload '{}' aborted: host validation failed", name);
return std::unexpected{LoadError::ActivationFailed};
}
// Atomic swap. The old instance keeps living while any acquired
// handle still pins it; it is destroyed when the last one drops.
entry.current.store(std::move(*next), std::memory_order_release);