Skip to content

Commit

Permalink
fixed a memory leak #15
Browse files Browse the repository at this point in the history
  • Loading branch information
fazalmajid committed Dec 1, 2020
1 parent e2d3318 commit 732470a
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions pinger.go
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ func (p *Pinger) processPacket(recv *packet, results chan *Result) error {
// XXX should lock p.pending
timeout, ok := p.pending[pkt.Seq]
if ok {
delete(p.pending, pkt.Seq)
timeout.timer.Stop()
}

Expand Down
1 change: 1 addition & 0 deletions pingwatch.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import (
"time"

_ "github.com/mattn/go-sqlite3"
// _ "net/http/pprof"
)

const date_fmt = "[02/Jan/2006:15:04:05 -0700]"
Expand Down
4 changes: 3 additions & 1 deletion webui.go
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,9 @@ func webui_worker(db *sql.DB) {
}

_, ordered, points := get_data(db, since)
log.Println("found", len(ordered), "points")
if *verbose {
log.Println("found", len(ordered), "points")
}
render_js_template(delta, w, r, map[string]interface{}{
"Ordered": ordered,
"Points": points,
Expand Down

0 comments on commit 732470a

Please sign in to comment.