Browse Source

implement close connection method to free shared memory pool

PHP-GTK3
yggverse 4 months ago
parent
commit
5b17cf6aca
  1. 5
      src/Abstract/Model/Connection.php
  2. 13
      src/Entity/Browser/Container/Page.php
  3. 2
      src/Interface/Model/Connection.php

5
src/Abstract/Model/Connection.php

@ -218,4 +218,9 @@ abstract class Connection implements \Yggverse\Yoda\Interface\Model\Connection @@ -218,4 +218,9 @@ abstract class Connection implements \Yggverse\Yoda\Interface\Model\Connection
return null;
}
public function close(): void
{
$this->_pool->reset(); // @TODO
}
}

13
src/Entity/Browser/Container/Page.php

@ -157,6 +157,7 @@ class Page @@ -157,6 +157,7 @@ class Page
// Redirect requested
if ($location = $connection->getRedirect())
{
// Follow
$this->open(
$location
);
@ -164,6 +165,9 @@ class Page @@ -164,6 +165,9 @@ class Page
// Hide progressbar
$this->progressbar->hide();
// Free shared memory pool
$connection->close();
return false; // stop
}
@ -178,6 +182,9 @@ class Page @@ -178,6 +182,9 @@ class Page
// Hide progressbar
$this->progressbar->hide();
// Free shared memory pool
$connection->close();
return false; // stop
}
@ -230,6 +237,9 @@ class Page @@ -230,6 +237,9 @@ class Page
// Hide progressbar
$this->progressbar->hide();
// Free shared memory pool
$connection->close();
// Stop
return false;
}
@ -250,6 +260,9 @@ class Page @@ -250,6 +260,9 @@ class Page
// Hide progressbar
$this->progressbar->hide();
// Free shared memory pool
$connection->close();
// Stop
return false;
}

2
src/Interface/Model/Connection.php

@ -76,4 +76,6 @@ interface Connection @@ -76,4 +76,6 @@ interface Connection
public function unsetRequest(): void;
public function getLength(): ?int;
public function close(): void;
}
Loading…
Cancel
Save