So while rebuilding the Plugin Host example app, I looked at the Xcode 8.3.3 compiler warnings/hints and could note a significant amount of potential memory leaks reported issues.
In particular, I was wondering why the example does not use a smart pointer maybe like the ScopedPointer<> class template (maybe a shared_ptr would be more approriate if ref is shared?) when creating a plugin instance in:
where the p pointer is created locally and then passed to a callback().
Because the callback is passed in parameter in this function it is hard to know if this is going to be a problem or not to not delete this ptr, so why not using a smart pointer there ?