Skip to content

Commit

Permalink
Fix #10842 - try catch around plugin.setup and make sure to release t…
Browse files Browse the repository at this point in the history
…he Python GIL
  • Loading branch information
jmarrec committed Dec 3, 2024
1 parent 0c73d29 commit 552f5dd
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/EnergyPlus/PluginManager.cc
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,12 @@ PluginManager::PluginManager(EnergyPlusData &state) : eplusRunningViaPythonAPI(s

// IMPORTANT - CALL setup() HERE ONCE ALL INSTANCES ARE CONSTRUCTED TO AVOID DESTRUCTOR/MEMORY ISSUES DURING VECTOR RESIZING
for (auto &plugin : state.dataPluginManager->plugins) {
plugin.setup(state);
try {
plugin.setup(state);
} catch (const FatalError &e) {
PyGILState_Release(gil);
throw e;
}
}

std::string const sGlobals = "PythonPlugin:Variables";
Expand Down

0 comments on commit 552f5dd

Please sign in to comment.