Skip to content

Commit

Permalink
Merge pull request #11 from zuoyebang/dev
Browse files Browse the repository at this point in the history
fix close task nil
  • Loading branch information
xingfu89 authored Jun 3, 2024
2 parents 1457fa2 + 2852e86 commit 0bf9854
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions db.go
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,12 @@ func (d *DB) IsClosed() bool {

func (d *DB) closeTask() {
close(d.taskClosed)
d.memFlushTask.Close()
d.bpageTask.Close()
if d.memFlushTask != nil {
d.memFlushTask.Close()
}
if d.bpageTask != nil {
d.bpageTask.Close()
}
d.taskWg.Wait()
}

Expand Down

0 comments on commit 0bf9854

Please sign in to comment.