Skip to content
This repository has been archived by the owner on May 30, 2023. It is now read-only.

Commit

Permalink
Fix crash running subwindows test
Browse files Browse the repository at this point in the history
See #13882
  • Loading branch information
mepard authored and vitallium committed Jan 23, 2016
1 parent 20d673b commit fd169e2
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/phantom.cpp
Expand Up @@ -522,7 +522,15 @@ void Phantom::doExit(int code)
emit aboutToExit(code);
m_terminated = true;
m_returnValue = code;
foreach(QPointer<WebPage> page, m_pages) {

// Iterate in reverse order so the first page is the last one scheduled for deletion.
// The first page is the root object, which will be invalidated when it is deleted.
// This causes an assertion to go off in BridgeJSC.cpp Instance::createRuntimeObject.
QListIterator<QPointer<WebPage> > i(m_pages);
i.toBack();
while (i.hasPrevious()) {
const QPointer<WebPage> page = i.previous();

if (!page) {
continue;
}
Expand Down

0 comments on commit fd169e2

Please sign in to comment.