we cannot cleanly restart with a new plugin through loading. must relaunch.

This commit is contained in:
Axel Kohlmeyer
2023-08-15 22:46:50 -04:00
parent 51cb6da4ca
commit 65cd6a3f2a
3 changed files with 32 additions and 12 deletions

View File

@ -228,7 +228,10 @@ bool LammpsWrapper::has_plugin() const
bool LammpsWrapper::load_lib(const char *libfile)
{
if (plugin_handle) liblammpsplugin_release((liblammpsplugin_t *)plugin_handle);
if (plugin_handle) {
close();
liblammpsplugin_release((liblammpsplugin_t *)plugin_handle);
}
plugin_handle = liblammpsplugin_load(libfile);
if (!plugin_handle) return false;
if (((liblammpsplugin_t *)plugin_handle)->abiversion != LAMMPSPLUGIN_ABI_VERSION) {