[cfe-commits] r154747 - /cfe/trunk/lib/AST/VTableBuilder.cpp
Matthieu Monrocq
matthieu.monrocq at gmail.com
Sat Apr 14 06:52:21 PDT 2012
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
-- Matthieu
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-commits/attachments/20120414/b4c10931/attachment.html>
More information about the cfe-commits
mailing list