Boost logo

Boost Users :

From: Peter Dimov (pdimov_at_[hidden])
Date: 2006-12-10 18:59:42


Phil Endecott wrote:
> Dear Boost experts,
>
> I have a C library that returns pointers to structs, and has special
> free functions that I must call to finalise and free these structs. Is
> there any way that I can create a shared_ptr that will call this
> special library free function when the last copy is destroyed?

Yes, there is:

shared_ptr< blob > pb( create_blob(), free_blob );


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net