diff --git a/mozilla/editor/base/DeleteElementTxn.cpp b/mozilla/editor/base/DeleteElementTxn.cpp index bfe55418fb8..66d03062ef0 100644 --- a/mozilla/editor/base/DeleteElementTxn.cpp +++ b/mozilla/editor/base/DeleteElementTxn.cpp @@ -76,8 +76,8 @@ NS_IMETHODIMP DeleteElementTxn::Do(void) { if (gNoisy) printf(" DeleteElementTxn: deleting child %s from parent %s\n", c, p); - delete [] c; - delete [] p; + nsCRT::free(c); + nsCRT::free(p); } // end debug output #endif @@ -115,8 +115,8 @@ NS_IMETHODIMP DeleteElementTxn::Undo(void) { if (gNoisy) printf(" DeleteElementTxn: inserting child %s back into parent %s\n", c, p); - delete [] c; - delete [] p; + nsCRT::free(c); + nsCRT::free(p); } // end debug output #endif diff --git a/mozilla/editor/base/nsEditorEventListeners.cpp b/mozilla/editor/base/nsEditorEventListeners.cpp index d7278006437..8af49b30e7c 100644 --- a/mozilla/editor/base/nsEditorEventListeners.cpp +++ b/mozilla/editor/base/nsEditorEventListeners.cpp @@ -377,7 +377,7 @@ nsTextEditorKeyListener::ProcessShortCutKeys(nsIDOMEvent* aKeyEvent, PRBool& aPr if (buf) { puts(buf); - delete[] buf; + nsCRT::free(buf); } } } @@ -781,7 +781,7 @@ nsTextEditorKeyListener::ProcessShortCutKeys(nsIDOMEvent* aKeyEvent, PRBool& aPr nsString *tag = styles.StringAt(i); char *tagCString = tag->ToNewCString(); printf("%s ", tagCString); - delete [] tagCString; + nsCRT::free(tagCString); } printf("\n"); } @@ -1418,7 +1418,7 @@ nsTextEditorDragListener::DragDrop(nsIDOMEvent* aMouseEvent) dragSession->SetCanDrop(PR_TRUE); } - delete [] whichFlavor; + nsCRT::free(whichFlavor); // XXX This is where image support might go //void * data; //trans->GetTransferData(mImageDataFlavor, (void **)&data, &len); diff --git a/mozilla/editor/base/nsEditorShell.cpp b/mozilla/editor/base/nsEditorShell.cpp index 954b2da8b54..ba022d2378c 100644 --- a/mozilla/editor/base/nsEditorShell.cpp +++ b/mozilla/editor/base/nsEditorShell.cpp @@ -365,7 +365,7 @@ nsEditorShell::InstantiateEditor(nsIDOMDocument *aDoc, nsIPresShell *aPresShell) errorMsg += "\"\n"; char *errorMsgCString = errorMsg.ToNewCString(); NS_WARNING(errorMsgCString); - delete [] errorMsgCString; + nsCRT::free(errorMsgCString); #endif } @@ -869,7 +869,7 @@ nsEditorShell::SetWebShellWindow(nsIDOMWindow* aWin) char* cstr = str.ToNewCString(); printf("Attaching to WebShellWindow[%s]\n", cstr); - delete[] cstr; + nsCRT::free(cstr); #endif nsCOMPtr webShellContainer; @@ -2906,7 +2906,7 @@ void nsEditorShell::SetButtonImage(nsIDOMNode * aParentNode, PRInt32 aBtnNum, co if (imgElement) { char * str = aResName.ToNewCString(); imgElement->SetSrc(str); - delete [] str; + nsCRT::free(str); } } @@ -2923,7 +2923,7 @@ nsEditorShell::ExecuteScript(nsIScriptContext * aContext, const nsString& aScrip #ifdef APP_DEBUG char* script_str = aScript.ToNewCString(); printf("Executing [%s]\n", script_str); - delete[] script_str; + nsCRT::free(script_str); #endif aContext->EvaluateString(aScript, url, 0, rVal, &isUndefined); diff --git a/mozilla/editor/base/nsHTMLEditor.cpp b/mozilla/editor/base/nsHTMLEditor.cpp index b1b25246c54..65ec5b53b08 100644 --- a/mozilla/editor/base/nsHTMLEditor.cpp +++ b/mozilla/editor/base/nsHTMLEditor.cpp @@ -446,7 +446,7 @@ NS_IMETHODIMP nsHTMLEditor::SetInlineProperty(nsIAtom *aProperty, aProperty->ToString(propString); char *propCString = propString.ToNewCString(); if (gNoisy) { printf("---------- start nsTextEditor::SetTextProperty %s ----------\n", propCString); } - delete [] propCString; + nsCRT::free(propCString); } nsresult result=NS_ERROR_NOT_INITIALIZED; @@ -563,7 +563,7 @@ NS_IMETHODIMP nsHTMLEditor::SetInlineProperty(nsIAtom *aProperty, aProperty->ToString(propString); char *propCString = propString.ToNewCString(); if (gNoisy) { printf("---------- end nsTextEditor::SetTextProperty %s ----------\n", propCString); } - delete [] propCString; + nsCRT::free(propCString); } return result; } @@ -582,7 +582,7 @@ NS_IMETHODIMP nsHTMLEditor::GetInlineProperty(nsIAtom *aProperty, aProperty->ToString(propString); char *propCString = propString.ToNewCString(); if (gNoisy) { printf("nsTextEditor::GetTextProperty %s\n", propCString); } - delete [] propCString; + nsCRT::free(propCString); } */ nsresult result; @@ -700,7 +700,7 @@ NS_IMETHODIMP nsHTMLEditor::RemoveInlineProperty(nsIAtom *aProperty, const nsStr aProperty->ToString(propString); char *propCString = propString.ToNewCString(); if (gNoisy) { printf("---------- start nsTextEditor::RemoveInlineProperty %s ----------\n", propCString); } - delete [] propCString; + nsCRT::free(propCString); } nsresult result; @@ -806,7 +806,7 @@ NS_IMETHODIMP nsHTMLEditor::RemoveInlineProperty(nsIAtom *aProperty, const nsStr aProperty->ToString(propString); char *propCString = propString.ToNewCString(); if (gNoisy) { printf("---------- end nsTextEditor::RemoveInlineProperty %s ----------\n", propCString); } - delete [] propCString; + nsCRT::free(propCString); } return result; } @@ -1390,7 +1390,7 @@ nsHTMLEditor::AddBlockParent(nsString& aParentTag) { char *tag = aParentTag.ToNewCString(); printf("---------- nsHTMLEditor::AddBlockParent %s ----------\n", tag); - delete [] tag; + nsCRT::free(tag); } nsresult res=NS_ERROR_NOT_INITIALIZED; @@ -1435,7 +1435,7 @@ nsHTMLEditor::ReplaceBlockParent(nsString& aParentTag) { char *tag = aParentTag.ToNewCString(); printf("---------- nsHTMLEditor::ReplaceBlockParent %s ----------\n", tag); - delete [] tag; + nsCRT::free(tag); } nsresult res=NS_ERROR_NOT_INITIALIZED; @@ -2608,7 +2608,7 @@ NS_IMETHODIMP nsHTMLEditor::SetBodyWrapWidth(PRInt32 aWrapColumn) #ifdef DEBUG_akkana char* curstyle = styleValue.ToNewCString(); printf("Setting style: [%s]\n", curstyle); - delete[] curstyle; + nsCRT::free(curstyle); #endif /* DEBUG_akkana */ return bodyElement->SetAttribute(styleName, styleValue); @@ -2932,7 +2932,7 @@ NS_IMETHODIMP nsHTMLEditor::Paste() #ifdef DEBUG_akkana char* flav = flavor.ToNewCString(); printf("Got flavor [%s]\n", flav); - delete[] flav; + nsCRT::free(flav); #endif if (flavor.Equals(kHTMLMime)) { @@ -2965,7 +2965,7 @@ NS_IMETHODIMP nsHTMLEditor::Paste() rv = NS_ERROR_NOT_IMPLEMENTED; // for now give error code } } - delete [] bestFlavor; + nsCRT::free(bestFlavor); } } } @@ -2990,19 +2990,19 @@ NS_IMETHODIMP nsHTMLEditor::OutputToString(nsString& aOutputString, else { // default processing nsCOMPtr encoder; - char* progid = new char[strlen(NS_DOC_ENCODER_PROGID_BASE) + aFormatType.Length() + 1]; + char* progid = (char *)nsAllocator::Alloc(strlen(NS_DOC_ENCODER_PROGID_BASE) + aFormatType.Length() + 1); if (! progid) return NS_ERROR_OUT_OF_MEMORY; strcpy(progid, NS_DOC_ENCODER_PROGID_BASE); char* type = aFormatType.ToNewCString(); strcat(progid, type); - delete[] type; + nsCRT::free(type); rv = nsComponentManager::CreateInstance(progid, nsnull, nsIDocumentEncoder::GetIID(), getter_AddRefs(encoder)); - delete[] progid; + nsCRT::free(progid); if (NS_FAILED(rv)) { printf("Couldn't get progid %s\n", progid); @@ -3058,20 +3058,20 @@ NS_IMETHODIMP nsHTMLEditor::OutputToStream(nsIOutputStream* aOutputStream, { nsresult rv; nsCOMPtr encoder; - char* progid = new char[strlen(NS_DOC_ENCODER_PROGID_BASE) + aFormatType.Length() + 1]; + char* progid = (char *)nsAllocator::Alloc(strlen(NS_DOC_ENCODER_PROGID_BASE) + aFormatType.Length() + 1); if (! progid) return NS_ERROR_OUT_OF_MEMORY; strcpy(progid, NS_DOC_ENCODER_PROGID_BASE); char* type = aFormatType.ToNewCString(); strcat(progid, type); - delete[] type; + nsCRT::free(type); rv = nsComponentManager::CreateInstance(progid, nsnull, nsIDocumentEncoder::GetIID(), getter_AddRefs(encoder)); - delete[] progid; + nsCRT::free(progid); if (NS_FAILED(rv)) { printf("Couldn't get progid %s\n", progid); @@ -3594,7 +3594,7 @@ nsHTMLEditor::ReParentContentOfNode(nsIDOMNode *aNode, { char *tag = aParentTag.ToNewCString(); printf("---------- ReParentContentOfNode(%p,%s,%d) -----------\n", aNode, tag, aTransformation); - delete [] tag; + nsCRT::free(tag); } // find the current block parent, or just use aNode if it is a block node nsCOMPtrblockParentElement; diff --git a/mozilla/editor/base/nsInsertHTMLTxn.cpp b/mozilla/editor/base/nsInsertHTMLTxn.cpp index d2a42b60cdb..0c47cf31ac5 100644 --- a/mozilla/editor/base/nsInsertHTMLTxn.cpp +++ b/mozilla/editor/base/nsInsertHTMLTxn.cpp @@ -63,7 +63,7 @@ NS_IMETHODIMP nsInsertHTMLTxn::Do(void) #ifdef DEBUG_akkana char* str = mSrc.ToNewCString(); printf("Calling nsInsertHTMLTxn::Do(%s)\n", str); - delete[] str; + nsCRT::free(str); #endif /* DEBUG_akkana */ nsCOMPtr docfrag; res = nsrange->CreateContextualFragment(mSrc, getter_AddRefs(docfrag)); diff --git a/mozilla/editor/base/nsTextEditRules.cpp b/mozilla/editor/base/nsTextEditRules.cpp index 7989ca2627a..cd25b00c9e8 100644 --- a/mozilla/editor/base/nsTextEditRules.cpp +++ b/mozilla/editor/base/nsTextEditRules.cpp @@ -629,7 +629,7 @@ nsTextEditRules::WillDeleteSelection(nsIDOMSelection *aSelection, #ifdef DEBUG_buster char *password = mPasswordText.ToNewCString(); printf("mPasswordText is %s\n", password); - delete [] password; + nsCRT::free(password); #endif } return NS_OK; @@ -989,7 +989,7 @@ nsTextEditRules::EchoInsertionToPWBuff(nsIDOMSelection *aSelection, nsString *aO #ifdef DEBUG_jfrancis char *password = mPasswordText.ToNewCString(); printf("mPasswordText is %s\n", password); - delete [] password; + nsCRT::free(password); #endif // change the output to '*' only diff --git a/mozilla/editor/base/nsTextEditor.cpp b/mozilla/editor/base/nsTextEditor.cpp index 8781bc658d9..2365891ad35 100644 --- a/mozilla/editor/base/nsTextEditor.cpp +++ b/mozilla/editor/base/nsTextEditor.cpp @@ -394,7 +394,7 @@ NS_IMETHODIMP nsTextEditor::SetTextProperty(nsIAtom *aProperty, aProperty->ToString(propString); char *propCString = propString.ToNewCString(); if (gNoisy) { printf("---------- start nsTextEditor::SetTextProperty %s ----------\n", propCString); } - delete [] propCString; + nsCRT::free(propCString); } nsresult result=NS_ERROR_NOT_INITIALIZED; @@ -510,7 +510,7 @@ NS_IMETHODIMP nsTextEditor::SetTextProperty(nsIAtom *aProperty, aProperty->ToString(propString); char *propCString = propString.ToNewCString(); if (gNoisy) { printf("---------- end nsTextEditor::SetTextProperty %s ----------\n", propCString); } - delete [] propCString; + nsCRT::free(propCString); } return result; } @@ -729,7 +729,7 @@ NS_IMETHODIMP nsTextEditor::RemoveTextProperty(nsIAtom *aProperty, const nsStrin aProperty->ToString(propString); char *propCString = propString.ToNewCString(); if (gNoisy) { printf("---------- start nsTextEditor::RemoveTextProperty %s ----------\n", propCString); } - delete [] propCString; + nsCRT::free(propCString); } nsresult result; @@ -818,7 +818,7 @@ NS_IMETHODIMP nsTextEditor::RemoveTextProperty(nsIAtom *aProperty, const nsStrin aProperty->ToString(propString); char *propCString = propString.ToNewCString(); if (gNoisy) { printf("---------- end nsTextEditor::RemoveTextProperty %s ----------\n", propCString); } - delete [] propCString; + nsCRT::free(propCString); } return result; } @@ -1484,7 +1484,6 @@ NS_IMETHODIMP nsTextEditor::ApplyStyleSheet(const nsString& aURL) return nsEditor::ApplyStyleSheet(aURL); } -NS_IMETHODIMP nsTextEditor::OutputToString(nsString& aOutputString, const nsString& aFormatType, PRUint32 aFlags) { @@ -1501,19 +1500,19 @@ NS_IMETHODIMP nsTextEditor::OutputToString(nsString& aOutputString, else { // default processing nsCOMPtr encoder; - char* progid = new char[strlen(NS_DOC_ENCODER_PROGID_BASE) + aFormatType.Length() + 1]; + char* progid = (char *)nsAllocator::Alloc(strlen(NS_DOC_ENCODER_PROGID_BASE) + aFormatType.Length() + 1); if (! progid) return NS_ERROR_OUT_OF_MEMORY; strcpy(progid, NS_DOC_ENCODER_PROGID_BASE); char* type = aFormatType.ToNewCString(); strcat(progid, type); - delete[] type; + nsCRT::free(type); rv = nsComponentManager::CreateInstance(progid, nsnull, nsIDocumentEncoder::GetIID(), getter_AddRefs(encoder)); - delete[] progid; + nsCRT::free(progid); if (NS_FAILED(rv)) { printf("Couldn't get progid %s\n", progid); @@ -1576,20 +1575,20 @@ NS_IMETHODIMP nsTextEditor::OutputToStream(nsIOutputStream* aOutputStream, { nsresult rv; nsCOMPtr encoder; - char* progid = new char[strlen(NS_DOC_ENCODER_PROGID_BASE) + aFormatType.Length() + 1]; + char* progid = (char *)nsAllocator::Alloc(strlen(NS_DOC_ENCODER_PROGID_BASE) + aFormatType.Length() + 1); if (! progid) return NS_ERROR_OUT_OF_MEMORY; strcpy(progid, NS_DOC_ENCODER_PROGID_BASE); char* type = aFormatType.ToNewCString(); strcat(progid, type); - delete[] type; + nsCRT::free(type); rv = nsComponentManager::CreateInstance(progid, nsnull, nsIDocumentEncoder::GetIID(), getter_AddRefs(encoder)); - delete[] progid; + nsCRT::free(progid); if (NS_FAILED(rv)) { printf("Couldn't get progid %s\n", progid); diff --git a/mozilla/editor/composer/src/nsEditorShell.cpp b/mozilla/editor/composer/src/nsEditorShell.cpp index 954b2da8b54..ba022d2378c 100644 --- a/mozilla/editor/composer/src/nsEditorShell.cpp +++ b/mozilla/editor/composer/src/nsEditorShell.cpp @@ -365,7 +365,7 @@ nsEditorShell::InstantiateEditor(nsIDOMDocument *aDoc, nsIPresShell *aPresShell) errorMsg += "\"\n"; char *errorMsgCString = errorMsg.ToNewCString(); NS_WARNING(errorMsgCString); - delete [] errorMsgCString; + nsCRT::free(errorMsgCString); #endif } @@ -869,7 +869,7 @@ nsEditorShell::SetWebShellWindow(nsIDOMWindow* aWin) char* cstr = str.ToNewCString(); printf("Attaching to WebShellWindow[%s]\n", cstr); - delete[] cstr; + nsCRT::free(cstr); #endif nsCOMPtr webShellContainer; @@ -2906,7 +2906,7 @@ void nsEditorShell::SetButtonImage(nsIDOMNode * aParentNode, PRInt32 aBtnNum, co if (imgElement) { char * str = aResName.ToNewCString(); imgElement->SetSrc(str); - delete [] str; + nsCRT::free(str); } } @@ -2923,7 +2923,7 @@ nsEditorShell::ExecuteScript(nsIScriptContext * aContext, const nsString& aScrip #ifdef APP_DEBUG char* script_str = aScript.ToNewCString(); printf("Executing [%s]\n", script_str); - delete[] script_str; + nsCRT::free(script_str); #endif aContext->EvaluateString(aScript, url, 0, rVal, &isUndefined); diff --git a/mozilla/editor/libeditor/base/DeleteElementTxn.cpp b/mozilla/editor/libeditor/base/DeleteElementTxn.cpp index bfe55418fb8..66d03062ef0 100644 --- a/mozilla/editor/libeditor/base/DeleteElementTxn.cpp +++ b/mozilla/editor/libeditor/base/DeleteElementTxn.cpp @@ -76,8 +76,8 @@ NS_IMETHODIMP DeleteElementTxn::Do(void) { if (gNoisy) printf(" DeleteElementTxn: deleting child %s from parent %s\n", c, p); - delete [] c; - delete [] p; + nsCRT::free(c); + nsCRT::free(p); } // end debug output #endif @@ -115,8 +115,8 @@ NS_IMETHODIMP DeleteElementTxn::Undo(void) { if (gNoisy) printf(" DeleteElementTxn: inserting child %s back into parent %s\n", c, p); - delete [] c; - delete [] p; + nsCRT::free(c); + nsCRT::free(p); } // end debug output #endif diff --git a/mozilla/editor/libeditor/html/nsHTMLEditor.cpp b/mozilla/editor/libeditor/html/nsHTMLEditor.cpp index b1b25246c54..65ec5b53b08 100644 --- a/mozilla/editor/libeditor/html/nsHTMLEditor.cpp +++ b/mozilla/editor/libeditor/html/nsHTMLEditor.cpp @@ -446,7 +446,7 @@ NS_IMETHODIMP nsHTMLEditor::SetInlineProperty(nsIAtom *aProperty, aProperty->ToString(propString); char *propCString = propString.ToNewCString(); if (gNoisy) { printf("---------- start nsTextEditor::SetTextProperty %s ----------\n", propCString); } - delete [] propCString; + nsCRT::free(propCString); } nsresult result=NS_ERROR_NOT_INITIALIZED; @@ -563,7 +563,7 @@ NS_IMETHODIMP nsHTMLEditor::SetInlineProperty(nsIAtom *aProperty, aProperty->ToString(propString); char *propCString = propString.ToNewCString(); if (gNoisy) { printf("---------- end nsTextEditor::SetTextProperty %s ----------\n", propCString); } - delete [] propCString; + nsCRT::free(propCString); } return result; } @@ -582,7 +582,7 @@ NS_IMETHODIMP nsHTMLEditor::GetInlineProperty(nsIAtom *aProperty, aProperty->ToString(propString); char *propCString = propString.ToNewCString(); if (gNoisy) { printf("nsTextEditor::GetTextProperty %s\n", propCString); } - delete [] propCString; + nsCRT::free(propCString); } */ nsresult result; @@ -700,7 +700,7 @@ NS_IMETHODIMP nsHTMLEditor::RemoveInlineProperty(nsIAtom *aProperty, const nsStr aProperty->ToString(propString); char *propCString = propString.ToNewCString(); if (gNoisy) { printf("---------- start nsTextEditor::RemoveInlineProperty %s ----------\n", propCString); } - delete [] propCString; + nsCRT::free(propCString); } nsresult result; @@ -806,7 +806,7 @@ NS_IMETHODIMP nsHTMLEditor::RemoveInlineProperty(nsIAtom *aProperty, const nsStr aProperty->ToString(propString); char *propCString = propString.ToNewCString(); if (gNoisy) { printf("---------- end nsTextEditor::RemoveInlineProperty %s ----------\n", propCString); } - delete [] propCString; + nsCRT::free(propCString); } return result; } @@ -1390,7 +1390,7 @@ nsHTMLEditor::AddBlockParent(nsString& aParentTag) { char *tag = aParentTag.ToNewCString(); printf("---------- nsHTMLEditor::AddBlockParent %s ----------\n", tag); - delete [] tag; + nsCRT::free(tag); } nsresult res=NS_ERROR_NOT_INITIALIZED; @@ -1435,7 +1435,7 @@ nsHTMLEditor::ReplaceBlockParent(nsString& aParentTag) { char *tag = aParentTag.ToNewCString(); printf("---------- nsHTMLEditor::ReplaceBlockParent %s ----------\n", tag); - delete [] tag; + nsCRT::free(tag); } nsresult res=NS_ERROR_NOT_INITIALIZED; @@ -2608,7 +2608,7 @@ NS_IMETHODIMP nsHTMLEditor::SetBodyWrapWidth(PRInt32 aWrapColumn) #ifdef DEBUG_akkana char* curstyle = styleValue.ToNewCString(); printf("Setting style: [%s]\n", curstyle); - delete[] curstyle; + nsCRT::free(curstyle); #endif /* DEBUG_akkana */ return bodyElement->SetAttribute(styleName, styleValue); @@ -2932,7 +2932,7 @@ NS_IMETHODIMP nsHTMLEditor::Paste() #ifdef DEBUG_akkana char* flav = flavor.ToNewCString(); printf("Got flavor [%s]\n", flav); - delete[] flav; + nsCRT::free(flav); #endif if (flavor.Equals(kHTMLMime)) { @@ -2965,7 +2965,7 @@ NS_IMETHODIMP nsHTMLEditor::Paste() rv = NS_ERROR_NOT_IMPLEMENTED; // for now give error code } } - delete [] bestFlavor; + nsCRT::free(bestFlavor); } } } @@ -2990,19 +2990,19 @@ NS_IMETHODIMP nsHTMLEditor::OutputToString(nsString& aOutputString, else { // default processing nsCOMPtr encoder; - char* progid = new char[strlen(NS_DOC_ENCODER_PROGID_BASE) + aFormatType.Length() + 1]; + char* progid = (char *)nsAllocator::Alloc(strlen(NS_DOC_ENCODER_PROGID_BASE) + aFormatType.Length() + 1); if (! progid) return NS_ERROR_OUT_OF_MEMORY; strcpy(progid, NS_DOC_ENCODER_PROGID_BASE); char* type = aFormatType.ToNewCString(); strcat(progid, type); - delete[] type; + nsCRT::free(type); rv = nsComponentManager::CreateInstance(progid, nsnull, nsIDocumentEncoder::GetIID(), getter_AddRefs(encoder)); - delete[] progid; + nsCRT::free(progid); if (NS_FAILED(rv)) { printf("Couldn't get progid %s\n", progid); @@ -3058,20 +3058,20 @@ NS_IMETHODIMP nsHTMLEditor::OutputToStream(nsIOutputStream* aOutputStream, { nsresult rv; nsCOMPtr encoder; - char* progid = new char[strlen(NS_DOC_ENCODER_PROGID_BASE) + aFormatType.Length() + 1]; + char* progid = (char *)nsAllocator::Alloc(strlen(NS_DOC_ENCODER_PROGID_BASE) + aFormatType.Length() + 1); if (! progid) return NS_ERROR_OUT_OF_MEMORY; strcpy(progid, NS_DOC_ENCODER_PROGID_BASE); char* type = aFormatType.ToNewCString(); strcat(progid, type); - delete[] type; + nsCRT::free(type); rv = nsComponentManager::CreateInstance(progid, nsnull, nsIDocumentEncoder::GetIID(), getter_AddRefs(encoder)); - delete[] progid; + nsCRT::free(progid); if (NS_FAILED(rv)) { printf("Couldn't get progid %s\n", progid); @@ -3594,7 +3594,7 @@ nsHTMLEditor::ReParentContentOfNode(nsIDOMNode *aNode, { char *tag = aParentTag.ToNewCString(); printf("---------- ReParentContentOfNode(%p,%s,%d) -----------\n", aNode, tag, aTransformation); - delete [] tag; + nsCRT::free(tag); } // find the current block parent, or just use aNode if it is a block node nsCOMPtrblockParentElement; diff --git a/mozilla/editor/libeditor/text/nsEditorEventListeners.cpp b/mozilla/editor/libeditor/text/nsEditorEventListeners.cpp index d7278006437..8af49b30e7c 100644 --- a/mozilla/editor/libeditor/text/nsEditorEventListeners.cpp +++ b/mozilla/editor/libeditor/text/nsEditorEventListeners.cpp @@ -377,7 +377,7 @@ nsTextEditorKeyListener::ProcessShortCutKeys(nsIDOMEvent* aKeyEvent, PRBool& aPr if (buf) { puts(buf); - delete[] buf; + nsCRT::free(buf); } } } @@ -781,7 +781,7 @@ nsTextEditorKeyListener::ProcessShortCutKeys(nsIDOMEvent* aKeyEvent, PRBool& aPr nsString *tag = styles.StringAt(i); char *tagCString = tag->ToNewCString(); printf("%s ", tagCString); - delete [] tagCString; + nsCRT::free(tagCString); } printf("\n"); } @@ -1418,7 +1418,7 @@ nsTextEditorDragListener::DragDrop(nsIDOMEvent* aMouseEvent) dragSession->SetCanDrop(PR_TRUE); } - delete [] whichFlavor; + nsCRT::free(whichFlavor); // XXX This is where image support might go //void * data; //trans->GetTransferData(mImageDataFlavor, (void **)&data, &len); diff --git a/mozilla/editor/libeditor/text/nsTextEditRules.cpp b/mozilla/editor/libeditor/text/nsTextEditRules.cpp index 7989ca2627a..cd25b00c9e8 100644 --- a/mozilla/editor/libeditor/text/nsTextEditRules.cpp +++ b/mozilla/editor/libeditor/text/nsTextEditRules.cpp @@ -629,7 +629,7 @@ nsTextEditRules::WillDeleteSelection(nsIDOMSelection *aSelection, #ifdef DEBUG_buster char *password = mPasswordText.ToNewCString(); printf("mPasswordText is %s\n", password); - delete [] password; + nsCRT::free(password); #endif } return NS_OK; @@ -989,7 +989,7 @@ nsTextEditRules::EchoInsertionToPWBuff(nsIDOMSelection *aSelection, nsString *aO #ifdef DEBUG_jfrancis char *password = mPasswordText.ToNewCString(); printf("mPasswordText is %s\n", password); - delete [] password; + nsCRT::free(password); #endif // change the output to '*' only