detached e91cdbb

fix: properly destroy WebViews to prevent memory leaks

Add WebView.Destroy() call in BrowserPane.Cleanup() to unregister
from global registry and release resources when closing stacked panes.
commit
e91cdbbc63a02270eb9e2f33f040c9649dbb1be5
author
bnema · · 2025-10-18 11:26 UTC
parent
32de2f6
signature
GPG Unverified2B82207D370127A0 The key is unknown
2 files · +10 -0
M CHANGELOG.md +1 -0
@@ -21,6 +21,7 @@ All notable changes to this project will be documented in this file.
2121 - Web app shortcuts: Ctrl+C, Ctrl+V, Ctrl+A now work in Gmail, VSCode web, etc.
2222 - Dark mode flash on startup: Set GTK dark theme preference and WebView background color before window/content creation
2323 - Cmd+Q and window close button now trigger graceful shutdown instead of killing the browser process
24+- WebView cleanup: Properly destroy WebViews to prevent memory leaks and duplicate handler registrations when closing stacked panes
2425
2526 ## [0.12.0] - 2025-10-16
2627
@@ -21,6 +21,7 @@ All notable changes to this project will be documented in this file.
21 - Web app shortcuts: Ctrl+C, Ctrl+V, Ctrl+A now work in Gmail, VSCode web, etc.21 - Web app shortcuts: Ctrl+C, Ctrl+V, Ctrl+A now work in Gmail, VSCode web, etc.
22 - Dark mode flash on startup: Set GTK dark theme preference and WebView background color before window/content creation22 - Dark mode flash on startup: Set GTK dark theme preference and WebView background color before window/content creation
23 - Cmd+Q and window close button now trigger graceful shutdown instead of killing the browser process23 - Cmd+Q and window close button now trigger graceful shutdown instead of killing the browser process
24+- WebView cleanup: Properly destroy WebViews to prevent memory leaks and duplicate handler registrations when closing stacked panes
24 25
25 ## [0.12.0] - 2025-10-1626 ## [0.12.0] - 2025-10-16
26 27
M internal/app/browser/pane.go +9 -0
@@ -121,6 +121,15 @@ func (p *BrowserPane) Cleanup() {
121121 }
122122 }
123123
124+ // Destroy WebView to unregister from global registry and release resources
125+ if p.webView != nil && !p.webView.IsDestroyed() {
126+ if err := p.webView.Destroy(); err != nil {
127+ log.Printf("[pane-%s] failed to destroy webview: %v", p.id, err)
128+ } else {
129+ log.Printf("[pane-%s] successfully destroyed webview", p.id)
130+ }
131+ }
132+
124133 // Clear tracking
125134 p.guiComponents = nil
126135 p.hasGUI = false
@@ -121,6 +121,15 @@ func (p *BrowserPane) Cleanup() {
121 }121 }
122 }122 }
123 123
124+ // Destroy WebView to unregister from global registry and release resources
125+ if p.webView != nil && !p.webView.IsDestroyed() {
126+ if err := p.webView.Destroy(); err != nil {
127+ log.Printf("[pane-%s] failed to destroy webview: %v", p.id, err)
128+ } else {
129+ log.Printf("[pane-%s] successfully destroyed webview", p.id)
130+ }
131+ }
132+
124 // Clear tracking133 // Clear tracking
125 p.guiComponents = nil134 p.guiComponents = nil
126 p.hasGUI = false135 p.hasGUI = false

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 8

Tags 42

↑↓ moveenter openesc close