1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 02:57:44 +00:00

Browser: Stop leaking popup windows

We were leaking the "view source" and "downloading file" windows for
some reason, presumably it was necessary when these were first added.
Since they are owned by the spawning browser window, there's no need
to leak them.
This commit is contained in:
Andreas Kling 2021-05-21 15:21:51 +02:00
parent f555c2cc95
commit 8a3e622538

View file

@ -61,7 +61,6 @@ void Tab::start_download(const URL& url)
window->set_resizable(false); window->set_resizable(false);
window->set_main_widget<DownloadWidget>(url); window->set_main_widget<DownloadWidget>(url);
window->show(); window->show();
[[maybe_unused]] auto& unused = window.leak_ref();
} }
void Tab::view_source(const URL& url, const String& source) void Tab::view_source(const URL& url, const String& source)
@ -76,7 +75,6 @@ void Tab::view_source(const URL& url, const String& source)
window->set_title(url.to_string()); window->set_title(url.to_string());
window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-text.png")); window->set_icon(Gfx::Bitmap::load_from_file("/res/icons/16x16/filetype-text.png"));
window->show(); window->show();
[[maybe_unused]] auto& unused = window.leak_ref();
} }
Tab::Tab(BrowserWindow& window, Type type) Tab::Tab(BrowserWindow& window, Type type)