Skip to content

Commit 09fa7d0

Browse files
[GTK][WPE] Network sessions are not destroyed in platformFinalize
https://bugs.webkit.org/show_bug.cgi?id=281143 Reviewed by Michael Catanzaro and Carlos Garcia Campos. When we close UIProcess it sends to NetworkProcess message(s) to destroy all sessions (DestroySession) but right after that the IPC connection is close which causes that NetworkProcess can be closed without destroying all sessions. This change destroys all sessions when the NetworkProcess is closing. Original author: Andrzej Surdej <Andrzej_Surdej@comcast.com> See: #1406 * Source/WebKit/NetworkProcess/soup/NetworkProcessMainSoup.cpp: Canonical link: https://commits.webkit.org/285119@main
1 parent f0b98a4 commit 09fa7d0

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

Source/WebKit/NetworkProcess/soup/NetworkProcessMainSoup.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,14 @@ class NetworkProcessMainSoup final: public AuxiliaryProcessMainBaseNoSingleton<N
4949

5050
void platformFinalize() override
5151
{
52-
// FIXME: Is this still needed? We should probably destroy all existing sessions at this point instead.
5352
// Needed to destroy the SoupSession and SoupCookieJar, e.g. to avoid
5453
// leaking SQLite temporary journaling files.
55-
process().destroySession(PAL::SessionID::defaultSessionID());
54+
Vector<PAL::SessionID> sessionIDs;
55+
process().forEachNetworkSession([&sessionIDs](auto& session) {
56+
sessionIDs.append(session.sessionID());
57+
});
58+
for (auto& sessionID : sessionIDs)
59+
process().destroySession(sessionID);
5660
}
5761
};
5862

0 commit comments

Comments
 (0)