Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Mullvad Browser
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
The Tor Project
Applications
Mullvad Browser
Commits
ff7e54e8
Commit
ff7e54e8
authored
19 years ago
by
bzbarsky%mit.edu
Browse files
Options
Downloads
Patches
Plain Diff
Make sure to null out the weak parent ptr in session history entries as
needed. Bug 305181, r=bryner, sr=jst
parent
b56f380d
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
docshell/shistory/src/nsSHEntry.cpp
+21
-0
21 additions, 0 deletions
docshell/shistory/src/nsSHEntry.cpp
with
21 additions
and
0 deletions
docshell/shistory/src/nsSHEntry.cpp
+
21
−
0
View file @
ff7e54e8
...
...
@@ -99,8 +99,20 @@ nsSHEntry::nsSHEntry(const nsSHEntry &other)
{
}
PR_STATIC_CALLBACK
(
PRBool
)
ClearParentPtr
(
nsISHEntry
*
aEntry
,
void
*
/* aData */
)
{
if
(
aEntry
)
{
aEntry
->
SetParent
(
nsnull
);
}
return
PR_TRUE
;
}
nsSHEntry
::~
nsSHEntry
()
{
// Since we never really remove kids from SHEntrys, we need to null
// out the mParent pointers on all our kids.
mChildren
.
EnumerateForwards
(
ClearParentPtr
,
nsnull
);
mChildren
.
Clear
();
RemoveDocumentObserver
();
if
(
mContentViewer
)
...
...
@@ -469,6 +481,15 @@ nsSHEntry::AddChild(nsISHEntry * aChild, PRInt32 aOffset)
//
NS_ASSERTION
(
aOffset
<
(
mChildren
.
Count
()
+
1023
),
"Large frames array!
\n
"
);
if
(
aOffset
<
mChildren
.
Count
())
{
nsISHEntry
*
oldChild
=
mChildren
.
ObjectAt
(
aOffset
);
if
(
oldChild
&&
oldChild
!=
aChild
)
{
NS_ERROR
(
"Adding child where we already have a child? "
"This will likely misbehave"
);
oldChild
->
SetParent
(
nsnull
);
}
}
// This implicitly extends the array to include aOffset
mChildren
.
ReplaceObjectAt
(
aChild
,
aOffset
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment