Skip to content
This repository has been archived by the owner on Dec 17, 2024. It is now read-only.

Commit

Permalink
Fixed memory leak in Ggr (fixes #196)
Browse files Browse the repository at this point in the history
  • Loading branch information
aandryashin authored and vania-pooh committed May 9, 2018
1 parent 574123d commit 32ddcee
Showing 1 changed file with 11 additions and 14 deletions.
25 changes: 11 additions & 14 deletions proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -98,20 +98,17 @@ func (c caps) capability(k string) string {
}

func (c caps) capabilityJsonWireW3C(jsonWire, W3C string) string {
ch := make(chan string)
go func(ch chan string) {
c.capabilities(func(m map[string]interface{}, w3c bool) {
k := jsonWire
if w3c {
k = W3C
}
if v, ok := m[k].(string); ok {
ch <- v
}
ch <- ""
})
}(ch)
return <-ch
result := ""
c.capabilities(func(m map[string]interface{}, w3c bool) {
k := jsonWire
if w3c {
k = W3C
}
if v, ok := m[k].(string); ok {
result = v
}
})
return result
}

func (c *caps) browser() string {
Expand Down

0 comments on commit 32ddcee

Please sign in to comment.