From 53bfc36a7338b6b3f25042ef4a3beed31e845c81 Mon Sep 17 00:00:00 2001 From: "bruce%cybersight.com" Date: Fri, 3 Sep 1999 13:45:10 +0000 Subject: [PATCH] Use nsCRT::free() instead of delete[] for char* data. --- widget/src/gtk/nsContextMenu.cpp | 4 ++-- widget/src/gtk/nsFileWidget.cpp | 4 ++-- widget/src/gtk/nsMenu.cpp | 6 +++--- widget/src/gtk/nsMenuBar.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/widget/src/gtk/nsContextMenu.cpp b/widget/src/gtk/nsContextMenu.cpp index 4d012200b41..d9e1e829c10 100644 --- a/widget/src/gtk/nsContextMenu.cpp +++ b/widget/src/gtk/nsContextMenu.cpp @@ -237,7 +237,7 @@ NS_METHOD nsContextMenu::AddMenu(nsIMenu * aMenu) NS_RELEASE(pnsMenuItem); } - delete[] labelStr; + nsCRT::free(labelStr); return NS_OK; } @@ -306,7 +306,7 @@ NS_METHOD nsContextMenu::RemoveItem(const PRUint32 aCount) /* gtk_menu_shell_remove (GTK_MENU_SHELL (mMenu), item); - delete[] labelStr; + nsCRT::free(labelStr); voidData = NULL; diff --git a/widget/src/gtk/nsFileWidget.cpp b/widget/src/gtk/nsFileWidget.cpp index 08fd64f44a6..370dc3b12e2 100644 --- a/widget/src/gtk/nsFileWidget.cpp +++ b/widget/src/gtk/nsFileWidget.cpp @@ -54,7 +54,7 @@ nsFileWidget::~nsFileWidget() gchar *data = (gchar*)gtk_object_get_data(GTK_OBJECT(menu_item), "filters"); if (data) - delete[] data; + nsCRT::free(data); } } @@ -163,7 +163,7 @@ NS_IMETHODIMP nsFileWidget::SetFilterList(PRUint32 aNumberOfFilters, gtk_menu_append(GTK_MENU(mFilterMenu), menu_item); gtk_widget_show(menu_item); - delete[] foo; + nsCRT::free(foo); } return NS_OK; diff --git a/widget/src/gtk/nsMenu.cpp b/widget/src/gtk/nsMenu.cpp index 57421284418..0cb045dfaee 100644 --- a/widget/src/gtk/nsMenu.cpp +++ b/widget/src/gtk/nsMenu.cpp @@ -181,7 +181,7 @@ NS_METHOD nsMenu::GetAccessKey(nsString &aText) g_print("GetAccessKey returns \"%s\"\n", foo); #endif - delete [] foo; + nsCRT::free(foo); return NS_OK; } @@ -195,7 +195,7 @@ NS_METHOD nsMenu::SetAccessKey(const nsString &aText) g_print("SetAccessKey setting to \"%s\"\n", foo); #endif - delete [] foo; + nsCRT::free(foo); return NS_OK; } @@ -383,7 +383,7 @@ NS_METHOD nsMenu::RemoveItem(const PRUint32 aPos) /* gtk_menu_shell_remove (GTK_MENU_SHELL (mMenu), item); - delete[] labelStr; + nsCRT::free(labelStr); voidData = NULL; diff --git a/widget/src/gtk/nsMenuBar.cpp b/widget/src/gtk/nsMenuBar.cpp index ca4dce089be..8cf7f5d13a7 100644 --- a/widget/src/gtk/nsMenuBar.cpp +++ b/widget/src/gtk/nsMenuBar.cpp @@ -156,7 +156,7 @@ NS_METHOD nsMenuBar::AddMenu(nsIMenu * aMenu) char *foo = Label.ToNewCString(); g_print("%s\n", foo); - delete [] foo; + nsCRT::free(foo); widget = nsMenuItem::CreateLocalized(Label); gtk_widget_show(widget);