Closed Bug 16837 Opened 25 years ago Closed 25 years ago

Home page is not working

Categories

(SeaMonkey :: UI Design, defect, P3)

Other
Other
defect

Tracking

(Not tracked)

VERIFIED WORKSFORME

People

(Reporter: mcafee, Assigned: warrensomebody)

Details

Warren's checkin to xpfe/browser/src/nsBrowserInstance.cpp
has broken the default home page behavior for me.
Backing this file out to -r1.25 fixes this.
What's the URL associated with this bug? I have a bug assiged to me that may be
a DUP of this bug.
The home page pref doesn't seem to be working.
Backing out warren's change as I described fixed
it for me this afternoon, I have not backed it out
in cvs though, waiting for warren or law to comment.
I detected this problem (I think) and alerted Warren this afternoon.  I've since
come up with this patch which Warren reviewed and I've been waiting to check in:

Index: nsBrowserInstance.cpp
===================================================================
RCS file: /cvsroot/mozilla/xpfe/browser/src/nsBrowserInstance.cpp,v
retrieving revision 1.26
diff -r1.26 nsBrowserInstance.cpp
1068c1068,1072
<       if (NS_SUCCEEDED(rv))
---
>       if (NS_SUCCEEDED(rv)) {
>         // Remove ourself as observer (Warning: Will cause dtor to run!).
>         NS_WITH_SERVICE(nsIObserverService, obsServ,
NS_OBSERVERSERVICE_PROGID, &rv);
>         nsAutoString topic("EndDocumentLoad");
>         if (NS_SUCCEEDED(rv)) obsServ->RemoveObserver(this,
topic.GetUnicode());
1069a1074
>       }
1122c1127
<     char* file;
---
>     char* file = 0;
1124c1129
<     if (NS_SUCCEEDED(rv)) {
---
>     if (NS_SUCCEEDED(rv)&&file) {

Note that all but the last 2 changed lines are a fix for another problem (the
PageCycler object is leaked).  I've tested this fix myself, on Windows.  Chris,
you might try applying it yourself to verify that it fixes this (and other?)
problem(s).
Status: NEW → ASSIGNED
Target Milestone: M11
Here's the diff that Bill just checked in:

diff -c -r1.26 -r1.27
*** nsBrowserInstance.cpp	1999/10/19 22:01:28	1.26
--- nsBrowserInstance.cpp	1999/10/20 14:40:25	1.27
***************
*** 1119,1127 ****
  #ifdef DEBUG
      // First, check if there's a URL file to load (for testing), and if there
      // is, process it instead of anything else.
!     char* file;
      rv = cmdLineArgs->GetCmdLineValue("-f", &file);
!     if (NS_SUCCEEDED(rv)) {
        PageCycler* bb = new PageCycler(this);
        if (bb == nsnull) {
          nsCRT::free(file);
--- 1119,1127 ----
  #ifdef DEBUG
      // First, check if there's a URL file to load (for testing), and if there
      // is, process it instead of anything else.
!     char* file = 0;
      rv = cmdLineArgs->GetCmdLineValue("-f", &file);
!     if (NS_SUCCEEDED(rv) && file) {
        PageCycler* bb = new PageCycler(this);
        if (bb == nsnull) {
          nsCRT::free(file);


a) It's missing the RemoveObserver stuff. We still want that, right?
b) I would argue that the bug is in GetCmdLineValue which shouldn't return NS_OK
and not set the out parameter.

If there are no objections, I'll make these 2 changes.

Warren
Status: ASSIGNED → RESOLVED
Closed: 25 years ago
Resolution: --- → FIXED
This looks like it's working now, marking fixed.
Status: RESOLVED → REOPENED
If you'll read my last comment, you'll see that it's not entirely fixed.
The problem Chris reported is fixed, though; he wasn't complaining about the
PageCycler being leaked.

I held off on that because I had concerns about causing the destruction of the
object while it was executing a member function.  That plus a report of a crash
at shutdown with some nsObserverService code on the stack.

I think the RemoveObserver is OK, but we should look at it a bit more closely.
Status: REOPENED → ASSIGNED
I think that RemoveObserver crash that was reported in viewer was because danm
changed nsAppShell.cpp for linux and it was crashing on shutdown. Completely
unrelated.

I'm going to apply the RemoveObserver patch to my code and check it out today.
I'm also going to fix GetCmdLineValue.
Resolution: FIXED → ---
Clearing FIXED resolution due to reopen of this bug.
Status: ASSIGNED → RESOLVED
Closed: 25 years ago25 years ago
Resolution: --- → WORKSFORME
Works for me. Please describe what you're seeing if you see something else.
QA Contact: don → sairuh
QA Contact: sairuh → claudius
mass-verifying WorksForMe bugs which haven't changed since 2001.12.31.

set your search string in mail to "EmperorLondoMollari" to filter out these
messages.
Status: RESOLVED → VERIFIED
Product: Core → Mozilla Application Suite
You need to log in before you can comment on or make changes to this bug.