From f700c7e14c6119a2bd6f8896f9b16108684cf906 Mon Sep 17 00:00:00 2001 From: "ager@chromium.org" Date: Thu, 4 Sep 2008 13:09:12 +0000 Subject: [PATCH] Minor cleanup: the smartpointer class should use DeleteArray to deallocate. git-svn-id: http://v8.googlecode.com/svn/branches/bleeding_edge@137 ce2b1a6d-e550-0410-aec6-3dcde31c8c00 --- src/objects.cc | 6 +++--- src/smart-pointer.h | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/objects.cc b/src/objects.cc index 87e07d9f8..2be4ccd80 100644 --- a/src/objects.cc +++ b/src/objects.cc @@ -2968,9 +2968,9 @@ SmartPointer String::ToCString(AllowNullsFlag allow_nulls, } -SmartPointer < char >String::ToCString(AllowNullsFlag allow_nulls, - RobustnessFlag robust_flag, - int* length_return) { +SmartPointer String::ToCString(AllowNullsFlag allow_nulls, + RobustnessFlag robust_flag, + int* length_return) { return ToCString(allow_nulls, robust_flag, 0, -1, length_return); } diff --git a/src/smart-pointer.h b/src/smart-pointer.h index 3fe27d4c7..7ff35c223 100644 --- a/src/smart-pointer.h +++ b/src/smart-pointer.h @@ -41,9 +41,9 @@ class SmartPointer { // When the destructor of the scoped pointer is executed the plain pointer - // is deleted using delete[]. This implies that you must allocate with - // new[...], not new(...). - inline ~SmartPointer() { if (p) delete [] p; } + // is deleted using DeleteArray. This implies that you must allocate with + // NewArray. + inline ~SmartPointer() { if (p) DeleteArray(p); } // Copy constructor removes the pointer from the original to avoid double -- 2.34.1