-
Notifications
You must be signed in to change notification settings - Fork 10
Description
The documentation for GameInterface::LoadPlugins()
, GameInterface::ClearLoadedPlugins()
, GameInterface::GetPlugin()
and GameInterface::GetLoadedPlugins()
predates the switch from const PluginInterface*
to std::shared_ptr<const PluginInterface>
in v0.26.0 and requires the implementation to keep copies of the pointers it returns. That didn't add any overhead in v0.26.x or v0.27.0, but does as of v0.27.0.
It would be good to update the documentation so that pointer validity is a reflection of the type used, i.e. because it's a std::shared_ptr
, it's valid for at least as long as the caller keeps a copy of the shared pointer, and libloot itself may or may not hold its own copies.
The current implementation would also support returning std::unique_ptr<const PluginInterface>
instead of std::shared_ptr<const PluginInterface>
, but it may be better to keep implementation options open to future changes by sticking to the latter, and the former not being copyable means that elements of std::vector<std::unique_ptr<const PluginInterface>>
could be more awkward to work with.