1 parent
4fca5523f6
commit
fa30098129
5 files changed
+59
No files matched your search
@@ -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);
|
||||
|
||||
Reference in new issue
Block a user