Index: Source/core/editing/FrameSelection.cpp |
diff --git a/Source/core/editing/FrameSelection.cpp b/Source/core/editing/FrameSelection.cpp |
index 3ed06bd5230897b9b7b542d23d353ef9c3b3b70b..4eef9cca74c5becefd6d5e52ff61c84a242db2ed 100644 |
--- a/Source/core/editing/FrameSelection.cpp |
+++ b/Source/core/editing/FrameSelection.cpp |
@@ -238,12 +238,16 @@ void FrameSelection::setSelection(const VisibleSelection& newSelection, SetSelec |
if (s.base().anchorNode()) { |
Document& document = *s.base().document(); |
if (document.frame() && document.frame() != m_frame && document != m_frame->document()) { |
- RefPtr<LocalFrame> guard = document.frame(); |
+ RefPtrWillBeRawPtr<LocalFrame> guard(document.frame()); |
document.frame()->selection().setSelection(s, options, align, granularity); |
// It's possible that during the above set selection, this FrameSelection has been modified by |
// selectFrameElementInParentIfFullySelected, but that the selection is no longer valid since |
// the frame is about to be destroyed. If this is the case, clear our selection. |
+#if ENABLE(OILPAN) |
+ if (guard->hasBeenClosed() && !m_selection.isNonOrphanedCaretOrRange()) |
+#else |
if (guard->hasOneRef() && !m_selection.isNonOrphanedCaretOrRange()) |
+#endif |
clear(); |
return; |
} |
@@ -1893,6 +1897,7 @@ void FrameSelection::showTreeForThis() const |
void FrameSelection::trace(Visitor* visitor) |
{ |
+ visitor->trace(m_frame); |
visitor->trace(m_selection); |
visitor->trace(m_originalBase); |
visitor->trace(m_logicalRange); |