()
| 289 | } |
| 290 | |
| 291 | func (this *SQLiteIPList) Close() error { |
| 292 | this.isClosed = true |
| 293 | |
| 294 | if this.db != nil { |
| 295 | for _, stmt := range []*dbs.Stmt{ |
| 296 | this.deleteExpiredItemsStmt, |
| 297 | this.deleteItemStmt, |
| 298 | this.insertItemStmt, |
| 299 | this.selectItemsStmt, |
| 300 | this.selectMaxItemVersionStmt, // ipItems table |
| 301 | |
| 302 | this.selectVersionStmt, // versions table |
| 303 | this.updateVersionStmt, |
| 304 | } { |
| 305 | if stmt != nil { |
| 306 | _ = stmt.Close() |
| 307 | } |
| 308 | } |
| 309 | |
| 310 | return this.db.Close() |
| 311 | } |
| 312 | return nil |
| 313 | } |