Skip to content

Commit 434336b

Browse files
committed
fix: avoid page leaking
1 parent bdb4f6e commit 434336b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

service.go

+2-2
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ func (b *Bartender) RenderPage(w http.ResponseWriter, r *http.Request) bool {
164164
page := b.getPage()
165165
defer b.pool.Put(page)
166166

167-
page, cancel := page.WithCancel()
167+
page, cancel := page.Context(r.Context()).WithCancel()
168168

169169
once := sync.Once{}
170170

@@ -178,7 +178,7 @@ func (b *Bartender) RenderPage(w http.ResponseWriter, r *http.Request) bool {
178178
})
179179
}()
180180

181-
_ = page.Context(r.Context()).Navigate(u)
181+
_ = page.Navigate(u)
182182

183183
_ = page.WaitStable(time.Second)
184184

0 commit comments

Comments
 (0)