mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
Ladybird: Close the current tab even if we're closing the window
Currently, if the JS console is open and tied to the last opened tab in the browser window, it will prevent the main process from exiting when the last tab is closed. This change explicitly closes that tab before closing the window (if it's the last tab), allowing Qt to delete the Tab object.
This commit is contained in:
parent
b326a301c3
commit
59b583329a
Notes:
sideshowbarker
2024-07-17 04:03:27 +09:00
Author: https://github.com/trflynn89 Commit: https://github.com/SerenityOS/serenity/commit/59b583329a Pull-request: https://github.com/SerenityOS/serenity/pull/20441
1 changed files with 3 additions and 4 deletions
|
@ -521,11 +521,10 @@ void BrowserWindow::open_file()
|
|||
|
||||
void BrowserWindow::close_current_tab()
|
||||
{
|
||||
auto count = m_tabs_container->count() - 1;
|
||||
if (!count)
|
||||
close_tab(m_tabs_container->currentIndex());
|
||||
|
||||
if (m_tabs_container->count() == 0)
|
||||
close();
|
||||
else
|
||||
close_tab(m_tabs_container->currentIndex());
|
||||
}
|
||||
|
||||
int BrowserWindow::tab_index(Tab* tab)
|
||||
|
|
Loading…
Reference in a new issue