[cfe-commits] r154747 - /cfe/trunk/lib/AST/VTableBuilder.cpp
Benjamin Kramer
benny.kra at googlemail.com
Sat Apr 14 07:14:33 PDT 2012
On 14.04.2012, at 15:52, Matthieu Monrocq wrote:
>
>
> Le 14 avril 2012 15:21, Benjamin Kramer <benny.kra at googlemail.com> a écrit :
> Author: d0k
> Date: Sat Apr 14 08:21:23 2012
> New Revision: 154747
>
> URL: http://llvm.org/viewvc/llvm-project?rev=154747&view=rev
> Log:
> Don't leak vtable thunks.
>
> Modified:
> cfe/trunk/lib/AST/VTableBuilder.cpp
>
> Modified: cfe/trunk/lib/AST/VTableBuilder.cpp
> URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/AST/VTableBuilder.cpp?rev=154747&r1=154746&r2=154747&view=diff
> ==============================================================================
> --- cfe/trunk/lib/AST/VTableBuilder.cpp (original)
> +++ cfe/trunk/lib/AST/VTableBuilder.cpp Sat Apr 14 08:21:23 2012
> @@ -2163,6 +2163,7 @@
>
> VTableLayout::~VTableLayout() {
> delete[] VTableComponents;
> + delete[] VTableThunks;
> }
>
> VTableContext::~VTableContext() {
>
>
> _______________________________________________
> cfe-commits mailing list
> cfe-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-commits
>
> Hello,
>
> I understand that sometimes memory management is not easy (while making use of other containers for example), however this seems a prime example for using OwningArrayPtr [1].
>
> Is there a specific reason it cannot be done ? It seems less error prone to me that manually deleting the memory, as your commit proves.
>
> [1]: http://llvm.org/docs/doxygen/html/classllvm_1_1OwningArrayPtr.html
Good idea! Fixed in r154748.
- Ben
>
> -- Matthieu
More information about the cfe-commits
mailing list