9 Feb
2016
9 Feb
'16
12:10 a.m.
On 5/02/2016 22:17, Rob Stewart wrote:
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 that 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 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.