From 0cc268758cad9a518154c9acf07e23998518dcda Mon Sep 17 00:00:00 2001 From: "radha%netscape.com" Date: Fri, 15 Oct 1999 03:49:29 +0000 Subject: [PATCH] fixing session history for frames. I accidently broke the behavior in my monday's checkin. No bug #. r=law --- xpfe/appshell/src/nsSessionHistory.cpp | 22 +++++----------------- 1 file changed, 5 insertions(+), 17 deletions(-) diff --git a/xpfe/appshell/src/nsSessionHistory.cpp b/xpfe/appshell/src/nsSessionHistory.cpp index 8811d129ee49..b3402e61b94c 100644 --- a/xpfe/appshell/src/nsSessionHistory.cpp +++ b/xpfe/appshell/src/nsSessionHistory.cpp @@ -489,6 +489,9 @@ nsHistoryEntry::Load(nsIWebShell * aPrevEntry, PRBool aIsReload) { cur = this; prev = aPrevEntry; + if (!cur || !prev) { + return NS_ERROR_NULL_POINTER; + } if (prev) { prev->GetURL(&pURL); pSURL = pURL; @@ -497,14 +500,10 @@ nsHistoryEntry::Load(nsIWebShell * aPrevEntry, PRBool aIsReload) { if (cur) { cur->GetURL(&cURL); cSURL = cURL; - Recycle(cURL); - } // NS_ADDREF(aPrevEntry); - if (!cur || !prev) { - return NS_ERROR_NULL_POINTER; - } + //Compare the URLs { @@ -514,10 +513,6 @@ nsHistoryEntry::Load(nsIWebShell * aPrevEntry, PRBool aIsReload) { urlChanged = PR_TRUE; } // compareURLs - - /* The URL to be loaded in it */ - cur->GetURL(&cURL); - if (urlChanged || aIsReload) { if (prev) { PRBool isInSHist=PR_FALSE, isLoadingDoc=PR_FALSE; @@ -567,8 +562,6 @@ nsHistoryEntry::Load(nsIWebShell * aPrevEntry, PRBool aIsReload) { if (APP_DEBUG) printf("SessionHistory::Load URLs in webshells %x & %x match \n", (unsigned int) mWS, (unsigned int) prev); } -// if (pSURL) delete pSURL; -// if (cSURL) delete cSURL; /* Make sure the child windows are in par */ PRInt32 cnt=0, ccnt=0, pcnt=0; ccnt = cur->GetChildCnt(); @@ -632,7 +625,6 @@ nsHistoryEntry::Compare(nsIWebShell * aPrevEntry, PRBool aIsReload) { if (cur) { cur->GetURL(&cURL); cSURL = (cURL); - Recycle(cURL); } //Compare the URLs { @@ -642,9 +634,6 @@ nsHistoryEntry::Compare(nsIWebShell * aPrevEntry, PRBool aIsReload) { urlChanged = PR_TRUE; } // compareURLs - /* The URL to be loaded in it */ - cur->GetURL(&cURL); - if (urlChanged /*|| aIsReload*/) { if (APP_DEBUG) printf("SessionHistory::Compare URLs in webshells %x & %x don't match \n", (unsigned int) mWS, (unsigned int) prev); @@ -656,8 +645,7 @@ nsHistoryEntry::Compare(nsIWebShell * aPrevEntry, PRBool aIsReload) { /* Mark the changed flag to false. This is used in the end to determine * whether we are done with the whole loading process for this history */ - if (APP_DEBUG) printf("SessionHistory::Compare URLs in webshells %x & %x match \n", (unsigned int) mWS, (unsigned int) prev); - + if (APP_DEBUG) printf("SessionHistory::Compare URLs in webshells %x & %x match \n", (unsigned int) mWS, (unsigned int) prev); } /* Make sure the child windows are in par */