Crash when closing window with multiple search tabs open
## Version information 488a721d88f9c346428f4f36fb091479672eaa0f on Arch Linux ## Steps to reproduce 1. `mkdir empty` 1. `thunar empty` 1. Press Ctrl + f to activate search 1. Press Ctrl + t to open a new tab 1. Press Ctrl + f to activate search in the new tab 1. Switch back to the first tab 1. Press Ctrl + q and select 'Close Window' to trigger a crash ## Current behavior Crash ## Expected outcome No crash when closing the window ## Backtrace `GLib-GObject-CRITICAL **: invalid cast from 'GtkGrid' to 'ThunarWindow'` ``` ERROR: AddressSanitizer: SEGV on unknown address 0x736ba5435b63 (pc 0x55e1b2cff6d8 bp 0x736ba5435b63 sp 0x7ffce6963810 T0) The signal is caused by a WRITE memory access. #0 0x55e1b2cff6d8 in __asan::asan_free(void*, __sanitizer::BufferedStackTrace*, __asan::AllocType) (/usr/asan/bin/thunar+0x3b36d8) #1 0x55e1b2de3822 in free.part.0 (/usr/asan/bin/thunar+0x497822) #2 0x55e1b321a87b in thunar_window_update_search thunar/thunar-window.c:3488:3 #3 0x55e1b304b919 in thunar_path_entry_changed thunar/thunar-path-entry.c:604:7 #4 0x736ba5814699 in g_closure_invoke /usr/src/debug/glib2/build/../glib/gobject/gclosure.c:834:7 #5 0x736ba58458a1 in signal_emit_unlocked_R.isra.0 /usr/src/debug/glib2/build/../glib/gobject/gsignal.c:3928:7 #6 0x736ba5835a0b in signal_emit_valist_unlocked /usr/src/debug/glib2/build/../glib/gobject/gsignal.c:3520:7 #7 0x736ba5835f51 in g_signal_emit_by_name /usr/src/debug/glib2/build/../glib/gobject/gsignal.c:3624:11 #8 0x736ba513f001 in end_change /usr/src/debug/gtk3/build/../gtk/gtk/gtkentry.c:2941:12 #9 0x736ba5150341 in gtk_entry_set_text /usr/src/debug/gtk3/build/../gtk/gtk/gtkentry.c:7736:3 #10 0x55e1b3036b0a in thunar_location_entry_accept_focus thunar/thunar-location-entry.c:291:7 #11 0x55e1b30188dc in thunar_location_bar_request_entry thunar/thunar-location-bar.c:352:7 #12 0x55e1b3259b74 in thunar_window_resume_search thunar/thunar-window.c:3459:3 #13 0x55e1b3257588 in thunar_window_switch_current_view thunar/thunar-window.c:2373:7 #14 0x55e1b324fc85 in thunar_window_notebook_switch_page thunar/thunar-window.c:2404:3 #15 0x55e1b3214723 in thunar_window_notebook_select_current_page thunar/thunar-window.c:2837:3 #16 0x55e1b3251535 in thunar_window_notebook_page_removed thunar/thunar-window.c:2525:9 [...snip...] ``` ## Additional information I was able to trigger the same crash with a commit before all my leak fixes (b76bcb417), so I don't think I introduced a regression.
issue