$include_dir="/home/hyper-archives/boost/include"; include("$include_dir/msg-header.inc") ?>
Subject: Re: [boost] News about proposed Boost.Application library
From: Peter Dimov (lists_at_[hidden])
Date: 2014-07-30 07:53:58
Klaim - Joël Lamotte wrote:
> Could you clarify what would happen here:
>
> shared_ptr<void()> p2;
> {
> shared_ptr<library> p = load_library( "mylib.so" );
> p2 = get_symbol<void()>( p, "myfunction" );
> } // p is destroyed
>
> (*p2)(); // ?
The library is kept alive by p2. But if you make p2 a weak_ptr, it isn't.