Skip to content

Commit

Permalink
Invalidate process object before destruction
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=265474
rdar://118721508

Reviewed by Brent Fulgham.

The process object in ProcessLauncher should be invalidated before destroyed.

* Source/WebKit/UIProcess/Launcher/ProcessLauncher.cpp:
(WebKit::ProcessLauncher::~ProcessLauncher):
* Source/WebKit/UIProcess/Launcher/ProcessLauncher.h:
* Source/WebKit/UIProcess/Launcher/cocoa/ProcessLauncherCocoa.mm:
(WebKit::ProcessLauncher::~ProcessLauncher):

Canonical link: https://commits.webkit.org/271255@main
  • Loading branch information
pvollan committed Nov 29, 2023
1 parent 6aa1f67 commit 6b158e3
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Source/WebKit/UIProcess/Launcher/ProcessLauncher.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,12 @@ ProcessLauncher::ProcessLauncher(Client* client, LaunchOptions&& launchOptions)
launchProcess();
}

#if !PLATFORM(COCOA)
ProcessLauncher::~ProcessLauncher()
{
}
#endif

void ProcessLauncher::didFinishLaunchingProcess(ProcessID processIdentifier, IPC::Connection::Identifier identifier)
{
tracePoint(ProcessLaunchEnd);
Expand Down
2 changes: 2 additions & 0 deletions Source/WebKit/UIProcess/Launcher/ProcessLauncher.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,8 @@ class ProcessLauncher : public ThreadSafeRefCountedAndCanMakeThreadSafeWeakPtr<P
return adoptRef(*new ProcessLauncher(client, WTFMove(launchOptions)));
}

virtual ~ProcessLauncher();

bool isLaunching() const { return m_isLaunching; }
ProcessID processID() const { return m_processID; }

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,13 @@ static void launchWithExtensionKit(ProcessLauncher& processLauncher, ProcessLaun
}
}

ProcessLauncher::~ProcessLauncher()
{
#if USE(EXTENSIONKIT)
[m_process invalidate];
#endif
}

void ProcessLauncher::launchProcess()
{
ASSERT(!m_xpcConnection);
Expand Down

0 comments on commit 6b158e3

Please sign in to comment.