opposite of registerCreator?

Hello again,

Is there a way to deregister a plugin creator? I see no such function on IPluginRegistry : https://github.com/NVIDIA/TensorRT/blob/07ed9b57b1ff7c24664388e5564b17f7ce2873e5/include/NvInferRuntimeCommon.h#L834. While there is a global registry from getPluginRegistry, I as a user may not want my creators to be statics (for example, we can run into the static initialization order fiasco, we might throw exceptions which cannot be caught, or might want to more tightly control lifetimes). And I can’t have non-static creators if there’s no way to deregister them from the global registry (we’d hit use-after-free). Alternatively, instead of having a global plugin registry, TensorRT could have a model closer to the old factory model: users would create their own registry, and pass that in to the functions which need it (for example parsers).


Regarding static objects, also note that many coding standards, including some used in safety-critical software, greatly limit the use of objects with static storage duration. For example, see AUTOSAR rule 3-3-2 (https://www.autosar.org/fileadmin/user_upload/standards/adaptive/18-10/AUTOSAR_RS_CPP14Guidelines.pdf), or the High Integrity C++ rule 3.3.1 (https://www.perforce.com/resources/qac/high-integrity-cpp-coding-standard/basic-concepts)


Looks like not something we want in regular TRT, but if it’s a request within the context of automotive safety, you should create a formal request through NV program manager.


One more point about the global IPluginRegistry: since we register creators with it, our creators basically have to be global too (to avoid use-after-free), but mutable globals (like creators) mean clients have to be weary of thread-safety issues. If we could create our own IPluginRegistry, none of this would be an issue.