fixed some UMR's due to mRefCnt being uninitialized. This fixes some memory leaks.

This commit is contained in:
buster%netscape.com 1999-01-28 19:45:23 +00:00
parent a71561f847
commit 666e4a3c97
5 changed files with 6 additions and 24 deletions

View File

@ -30,6 +30,7 @@ NS_IMPL_RELEASE(EditTxn)
// note that aEditor is not refcounted
EditTxn::EditTxn()
{
NS_INIT_REFCNT();
}
nsresult EditTxn::Do(void)

View File

@ -470,24 +470,6 @@ nsEditor::Commit(PRBool aCtrlKey)
//BEGIN nsEditor Private methods
nsresult
nsEditor::GetCurrentNode(nsIDOMNode ** aNode)
{
if (!aNode)
return NS_ERROR_NULL_POINTER;
if (!mDoc)
return NS_ERROR_NULL_POINTER;
/* If no node set, get first text node */
nsCOMPtr<nsIDOMElement> docNode;
if (NS_SUCCEEDED(mDoc->GetDocumentElement(getter_AddRefs(docNode))))
{
return docNode->QueryInterface(kIDOMNodeIID,(void **) aNode);
}
return NS_ERROR_FAILURE;
}
nsresult
nsEditor::GetFirstNodeOfType(nsIDOMNode *aStartNode, const nsString &aTag, nsIDOMNode **aResult)
{

View File

@ -147,17 +147,13 @@ public:
/*BEGIN private methods used by the implementations of the above functions*/
/** GetCurrentNode ADDREFFS and will get the current node from selection.
* now it simply returns the first node in the dom
* @param nsIDOMNode **aNode is the return location of the dom node
*/
nsresult GetCurrentNode(nsIDOMNode ** aNode);
/** GetFirstTextNode ADDREFFS and will get the next available text node from the passed
* in node parameter it can also return NS_ERROR_FAILURE if no text nodes are available
* now it simply returns the first node in the dom
* @param nsIDOMNode *aNode is the node to start looking from
* @param nsIDOMNode **aRetNode is the return location of the text dom node
*
* NOTE: this method will probably be removed.
*/
nsresult GetFirstTextNode(nsIDOMNode *aNode, nsIDOMNode **aRetNode);

View File

@ -42,6 +42,7 @@ NS_IMPL_RELEASE(nsEditorKeyListener)
nsEditorKeyListener::nsEditorKeyListener()
{
NS_INIT_REFCNT();
}
@ -338,6 +339,7 @@ NS_IMPL_RELEASE(nsEditorMouseListener)
nsEditorMouseListener::nsEditorMouseListener()
{
NS_INIT_REFCNT();
}

View File

@ -30,6 +30,7 @@ NS_IMPL_RELEASE(EditTxn)
// note that aEditor is not refcounted
EditTxn::EditTxn()
{
NS_INIT_REFCNT();
}
nsresult EditTxn::Do(void)