IOnnxConfig cannot be destructed - memory leak?


I am going through the ONNX C++ sample and I noticed that some heap memory is allocated for the ONNX configuration:

nvonnxparser::IOnnxConfig* config = nvonnxparser::createONNXConfig();

However this config does not have the usual destroy() method. Besides, the destructor of IOnnxConfig is protected virtual, so we cannot simply delete the config.

Is this intentional? The sample, as provided, would then have a memory leak since the config is not destroyed in any way (checked with Valgrind).

You are correct, thank you for pointing this out, will fix it.