From 22143d320877b8d1119f6efcacb8ea3d700ab4a5 Mon Sep 17 00:00:00 2001 From: "waterson%netscape.com" Date: Sun, 29 Aug 1999 19:38:41 +0000 Subject: [PATCH] Clean up comments; no more delete[]. --- string/obsolete/nsXPIDLString.h | 7 ++----- xpcom/ds/nsXPIDLString.h | 7 ++----- xpcom/string/obsolete/nsXPIDLString.h | 7 ++----- 3 files changed, 6 insertions(+), 15 deletions(-) diff --git a/string/obsolete/nsXPIDLString.h b/string/obsolete/nsXPIDLString.h index dd4bbf97ff0..5c36d9c9f3d 100644 --- a/string/obsolete/nsXPIDLString.h +++ b/string/obsolete/nsXPIDLString.h @@ -44,10 +44,7 @@ aFoo->GetFoo(&bar); // Use bar here... printf("bar is %s!\n", bar); - delete[] bar; - - (Strictly speaking, the `delete[] bar' should use the proper XPCOM - de-allocator; we'll ignore that for now.) + nsAllocator::Free(bar); This makes your life harder, because you need to convolute your code to ensure that you don't leak `bar'. @@ -61,7 +58,7 @@ aFoo->GetFoo( getter_Copies(bar) ); // Use bar here... printf("bar is %s!\n", (const char*) bar); - // no need to remember to delete[]. + // no need to remember to nsAllocator::Free(). Like nsCOMPtr, nsXPIDLString uses some syntactic sugar to make it painfully clear exactly what the code expects. You need to wrap an diff --git a/xpcom/ds/nsXPIDLString.h b/xpcom/ds/nsXPIDLString.h index dd4bbf97ff0..5c36d9c9f3d 100644 --- a/xpcom/ds/nsXPIDLString.h +++ b/xpcom/ds/nsXPIDLString.h @@ -44,10 +44,7 @@ aFoo->GetFoo(&bar); // Use bar here... printf("bar is %s!\n", bar); - delete[] bar; - - (Strictly speaking, the `delete[] bar' should use the proper XPCOM - de-allocator; we'll ignore that for now.) + nsAllocator::Free(bar); This makes your life harder, because you need to convolute your code to ensure that you don't leak `bar'. @@ -61,7 +58,7 @@ aFoo->GetFoo( getter_Copies(bar) ); // Use bar here... printf("bar is %s!\n", (const char*) bar); - // no need to remember to delete[]. + // no need to remember to nsAllocator::Free(). Like nsCOMPtr, nsXPIDLString uses some syntactic sugar to make it painfully clear exactly what the code expects. You need to wrap an diff --git a/xpcom/string/obsolete/nsXPIDLString.h b/xpcom/string/obsolete/nsXPIDLString.h index dd4bbf97ff0..5c36d9c9f3d 100644 --- a/xpcom/string/obsolete/nsXPIDLString.h +++ b/xpcom/string/obsolete/nsXPIDLString.h @@ -44,10 +44,7 @@ aFoo->GetFoo(&bar); // Use bar here... printf("bar is %s!\n", bar); - delete[] bar; - - (Strictly speaking, the `delete[] bar' should use the proper XPCOM - de-allocator; we'll ignore that for now.) + nsAllocator::Free(bar); This makes your life harder, because you need to convolute your code to ensure that you don't leak `bar'. @@ -61,7 +58,7 @@ aFoo->GetFoo( getter_Copies(bar) ); // Use bar here... printf("bar is %s!\n", (const char*) bar); - // no need to remember to delete[]. + // no need to remember to nsAllocator::Free(). Like nsCOMPtr, nsXPIDLString uses some syntactic sugar to make it painfully clear exactly what the code expects. You need to wrap an