Skip to content

Commit 2a94db2

Browse files
committed
Fixed Leveldb DriverClear notice
1 parent f07a240 commit 2a94db2

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/phpFastCache/Drivers/Leveldb/Driver.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ protected function driverClear()
127127
{
128128
if ($this->instance instanceof LeveldbClient) {
129129
$this->instance->close();
130-
unset($this->instance);
130+
$this->instance = null;
131131
}
132132
$result = LeveldbClient::destroy($this->getLeveldbFile());
133133
$this->driverConnect();
@@ -169,6 +169,9 @@ public function getStats()
169169
*/
170170
public function __destruct()
171171
{
172-
$this->instance->close();
172+
if ($this->instance instanceof LeveldbClient) {
173+
$this->instance->close();
174+
$this->instance = null;
175+
}
173176
}
174177
}

0 commit comments

Comments
 (0)