aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/files_external/lib/Lib/Storage/FTP.php6
-rw-r--r--apps/files_external/tests/Storage/FtpTest.php1
2 files changed, 6 insertions, 1 deletions
diff --git a/apps/files_external/lib/Lib/Storage/FTP.php b/apps/files_external/lib/Lib/Storage/FTP.php
index 8f7155727be..3edf22d03fc 100644
--- a/apps/files_external/lib/Lib/Storage/FTP.php
+++ b/apps/files_external/lib/Lib/Storage/FTP.php
@@ -40,7 +40,7 @@ class FTP extends Common {
private $port;
private $utf8Mode;
- /** @var FtpConnection */
+ /** @var FtpConnection|null */
private $connection;
public function __construct($params) {
@@ -65,6 +65,10 @@ class FTP extends Common {
}
}
+ public function __destruct() {
+ $this->connection = null;
+ }
+
protected function getConnection(): FtpConnection {
if (!$this->connection) {
try {
diff --git a/apps/files_external/tests/Storage/FtpTest.php b/apps/files_external/tests/Storage/FtpTest.php
index 3a8f94fb7fe..461e1ffb5c3 100644
--- a/apps/files_external/tests/Storage/FtpTest.php
+++ b/apps/files_external/tests/Storage/FtpTest.php
@@ -59,6 +59,7 @@ class FtpTest extends \Test\Files\Storage\Storage {
if ($this->instance) {
$this->instance->rmdir('');
}
+ $this->instance = null;
parent::tearDown();
}