You are here

public function Database::__destruct in Smart IP 6.2

Same name and namespace in other branches
  1. 7.2 includes/vendor/ip2location/ip2location-php/IP2Location.php \IP2Location\Database::__destruct()

Destructor

@access public

File

includes/vendor/ip2location/ip2location-php/IP2Location.php, line 763

Class

Database
IP2Location database class

Namespace

IP2Location

Code

public function __destruct() {
  switch ($this->mode) {
    case self::FILE_IO:

      // free the file pointer
      if (false !== $this->resource) {
        fclose($this->resource);
        $this->resource = false;
      }
      break;
    case self::SHARED_MEMORY:

      // detach from the memory segment
      if (false !== $this->resource) {
        shmop_close($this->resource);
        $this->resource = false;
      }
      break;
  }
}