summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2021-01-26 09:56:37 +0000
committerMoonchild <moonchild@palemoon.org>2021-01-26 09:56:37 +0000
commitc1dd23bd83eddaa5e7908f90775da949c96afd8a (patch)
tree25197f53a89af92d958348d6e367efe3d20546ed
parentdd932e001139845ec4c1bb5acbbb2573d62c74e4 (diff)
downloaduxp-c1dd23bd83eddaa5e7908f90775da949c96afd8a.tar.gz
[layout, XUL] Avoid accessing invalidated frame.
-rw-r--r--layout/xul/tree/nsTreeBodyFrame.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/layout/xul/tree/nsTreeBodyFrame.cpp b/layout/xul/tree/nsTreeBodyFrame.cpp
index b31d1de367..ec054a234e 100644
--- a/layout/xul/tree/nsTreeBodyFrame.cpp
+++ b/layout/xul/tree/nsTreeBodyFrame.cpp
@@ -1826,12 +1826,17 @@ nsTreeBodyFrame::RowCountChanged(int32_t aIndex, int32_t aCount)
FireRowCountChangedEvent(aIndex, aCount);
#endif
+ nsWeakFrame weakFrame(this);
+
// Adjust our selection.
+ nsCOMPtr<nsITreeView> view = mView;
nsCOMPtr<nsITreeSelection> sel;
- mView->GetSelection(getter_AddRefs(sel));
+ view->GetSelection(getter_AddRefs(sel));
if (sel)
sel->AdjustSelection(aIndex, aCount);
+ NS_ENSURE_STATE (weakFrame.IsAlive());
+
if (mUpdateBatchNest)
return NS_OK;