Index: Source/core/frame/Frame.cpp |
diff --git a/Source/core/frame/Frame.cpp b/Source/core/frame/Frame.cpp |
index 4b4894a999c34a8a5722a6e8ba17a18391c5a651..f647b3e5988b5ed202236a17a12183a39112612d 100644 |
--- a/Source/core/frame/Frame.cpp |
+++ b/Source/core/frame/Frame.cpp |
@@ -91,6 +91,18 @@ Frame::~Frame() |
#endif |
} |
+void Frame::detachChildren() |
+{ |
+ typedef Vector<RefPtr<Frame> > FrameVector; |
+ FrameVector childrenToDetach; |
+ childrenToDetach.reserveCapacity(tree().childCount()); |
+ for (Frame* child = tree().firstChild(); child; child = child->tree().nextSibling()) |
+ childrenToDetach.append(child); |
+ FrameVector::iterator end = childrenToDetach.end(); |
+ for (FrameVector::iterator it = childrenToDetach.begin(); it != end; ++it) |
+ (*it)->detach(); |
+} |
+ |
FrameHost* Frame::host() const |
{ |
return m_host; |