[Bug] Crash on failed SSH connection #9

Closed
opened 2026-09-07 15:34:40 +00:00 by x3 · 0 comments
Owner

Bug: App crashes when an SSH connection fails (wrong password, host unreachable, etc.)

Root cause: delete term was called BEFORE gtk_notebook_remove_page(), destroying the VTE widget while GTK still held a reference.

Fix: In ssh_client.cpp, always call gtk_notebook_remove_page() first, then delete term:

// Before (crashes):
delete term;
gtk_notebook_remove_page(GTK_NOTEBOOK(notebook_), idx);

// After (fixed):
gtk_notebook_remove_page(GTK_NOTEBOOK(notebook_), idx);
delete term;

Also removed cleanup_done_ flag pattern - each error path now does manual resource cleanup instead of relying on a single cleanup() method.

Status: Fixed in commit 6e719c3

**Bug:** App crashes when an SSH connection fails (wrong password, host unreachable, etc.) **Root cause:** `delete term` was called BEFORE `gtk_notebook_remove_page()`, destroying the VTE widget while GTK still held a reference. **Fix:** In `ssh_client.cpp`, always call `gtk_notebook_remove_page()` first, then `delete term`: ```cpp // Before (crashes): delete term; gtk_notebook_remove_page(GTK_NOTEBOOK(notebook_), idx); // After (fixed): gtk_notebook_remove_page(GTK_NOTEBOOK(notebook_), idx); delete term; ``` Also removed `cleanup_done_` flag pattern - each error path now does manual resource cleanup instead of relying on a single cleanup() method. **Status:** Fixed in commit 6e719c3
x3 closed this issue 2026-09-07 16:58:14 +00:00
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: x3/x3-ssh#9