[Lldb-commits] [PATCH] Introduce a new UnwindAssemblySP shared pointer type and use it to fix a memory leak. We are never deleting UnwindAssembly.
Jean-Daniel Dupas
devlists at shadowlab.org
Mon Feb 3 15:13:03 PST 2014
Here is an updated patch.
Le 3 févr. 2014 à 23:43, Jean-Daniel Dupas <devlists at shadowlab.org> a écrit :
> Thank you for the explanation. I missed that point when I read about 'shared_from_this'.
>
> Le 3 févr. 2014 à 20:49, Greg Clayton <gclayton at apple.com> a écrit :
>
>> UnwindAssembly::FindPlugin() needs to be modified to return a UnwindAssemblySP and when each UnwindAssembly object is created you need to immediately put it into a shared pointer upon construction. When using enable_shared_from_this() you _must_ create the object by putting it into a shared pointer right away, otherwise when you use "unwinder.shared_from_this()" you will crash as the std::weak_ptr inside the enable_shared_from_this() class won't have been initialized correctly.
>>
>> On Feb 2, 2014, at 6:00 AM, Jean-Daniel Dupas <devlists at shadowlab.org> wrote:
>>
-- Jean-Daniel
-------------- next part --------------
A non-text attachment was scrubbed...
Name: unwinder.patch
Type: application/octet-stream
Size: 3869 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20140204/6ae021e2/attachment.obj>
More information about the lldb-commits
mailing list