ScriptController::ShellMap::iterator windowShellsEnd = windowShells.end();
for (ScriptController::ShellMap::iterator iter = windowShells.begin(); iter != windowShellsEnd; ++iter) {
JSDOMWindow* window = iter->second->window();
- m_windows.add(iter->first.get(), window);
+ m_windows.add(iter->first.get(), Strong<JSDOMWindow>(window->globalData(), window));
m_domWindow = window->impl();
}
DOMWrapperWorld* world = iter->first.get();
JSDOMWindowShell* windowShell = iter->second.get();
- if (JSDOMWindow* window = m_windows.get(world))
- windowShell->setWindow(window);
+ if (JSDOMWindow* window = m_windows.get(world).get())
+ windowShell->setWindow(window->globalData(), window);
else {
windowShell->setWindow(frame->domWindow());