[lldb-dev] Can Process hold a TargetSP instead of a Target&?
Zachary Turner via lldb-dev
lldb-dev at lists.llvm.org
Mon Aug 31 16:28:13 PDT 2015
Sounds good. I already have that working in a local patch, but I will wait
for the fix you described earlier to go in first, and handle the merge and
check in the weak_ptr change.
On Mon, Aug 31, 2015 at 2:53 PM Greg Clayton <gclayton at apple.com> wrote:
>
> > On Aug 31, 2015, at 1:34 PM, Zachary Turner <zturner at google.com> wrote:
> >
> > Windows plugin holds a strong reference to itself. It calls
> shared_from_this() when the process is launched, and it releases this
> strong reference after a process exits. It does this because the debug
> loop happens in a different thread, and it wanted to ensure that the
> process plugin cannot be killed before we've cleaned up gracefully.
> >
> > Should this also be changed to a weak_ptr?
>
> I would change it to a std::weak_ptr if possible. That way if the plug-in
> goes away, you will try to lock the weak pointer and notice the shared
> pointer is NULL and know the process is gone and you can proceed to shut
> down this extra thread.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20150831/512f3925/attachment-0001.html>
More information about the lldb-dev
mailing list