On February 8, 2016 7:10:47 PM EST, Gavin Lambert
shared_ptr can be used to manage memory differently than you imagine, it seems. I use shared_ptrs to share ownership between a plugin and the application loading it while using custom deleters to ensure
releasing the last reference means code in the dynamic library releases the memory, if indeed any was allocated. The plugin mechanism release such references before unloading a dynamic
On 5/02/2016 22:17, Rob Stewart wrote: that library,
so all's well.
That's fine, and a perfectly reasonable use of a custom deleter.
That's not what I was talking about, which was specifically limited to abuse of a null_deleter.
While I didn't mention it, I sometimes use a null deleter, in the same context, for static objects in the dynamic library. ___ Rob (Sent from my portable computation engine)