From e77fec1f1c61c9f80fc9cc51545e3663c5a55dc6 Mon Sep 17 00:00:00 2001 From: yggverse Date: Fri, 26 Jul 2024 18:41:39 +0300 Subject: [PATCH] free memory pool on tab close --- src/Entity/Browser/Container/Tab.php | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/Entity/Browser/Container/Tab.php b/src/Entity/Browser/Container/Tab.php index a118a110..7d3dad7c 100644 --- a/src/Entity/Browser/Container/Tab.php +++ b/src/Entity/Browser/Container/Tab.php @@ -70,6 +70,7 @@ class Tab $page->title->getValue(), $page->title->getSubtitle() ); + } else throw new Exception; // Keep current selection @@ -95,6 +96,17 @@ class Tab ?GtkWidget $child, int $page_num ) { + // Free memory pool + if ($page = $this->get($page_num)) + { + if ($page->connection) + { + $page->connection->close(); + } + + } else throw new Exception; + + // Reorder pages $this->reorder(); } );