mirror of
https://github.com/YGGverse/Yoda.git
synced 2026-04-01 09:05:27 +00:00
implement close connection method to free shared memory pool
This commit is contained in:
parent
ed31a3b13f
commit
5b17cf6aca
3 changed files with 20 additions and 0 deletions
|
|
@ -218,4 +218,9 @@ abstract class Connection implements \Yggverse\Yoda\Interface\Model\Connection
|
|||
|
||||
return null;
|
||||
}
|
||||
|
||||
public function close(): void
|
||||
{
|
||||
$this->_pool->reset(); // @TODO
|
||||
}
|
||||
}
|
||||
|
|
@ -157,6 +157,7 @@ class Page
|
|||
// Redirect requested
|
||||
if ($location = $connection->getRedirect())
|
||||
{
|
||||
// Follow
|
||||
$this->open(
|
||||
$location
|
||||
);
|
||||
|
|
@ -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
|
|||
// Hide progressbar
|
||||
$this->progressbar->hide();
|
||||
|
||||
// Free shared memory pool
|
||||
$connection->close();
|
||||
|
||||
return false; // stop
|
||||
}
|
||||
|
||||
|
|
@ -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
|
|||
// Hide progressbar
|
||||
$this->progressbar->hide();
|
||||
|
||||
// Free shared memory pool
|
||||
$connection->close();
|
||||
|
||||
// Stop
|
||||
return false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -76,4 +76,6 @@ interface Connection
|
|||
public function unsetRequest(): void;
|
||||
|
||||
public function getLength(): ?int;
|
||||
|
||||
public function close(): void;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue