Fix crash when changing tab titles from the preferences dialog (#808)
This MR aims to fix issue #808 (closed).
As @Tamaranch suggested, switching from g_signal_connect_swapped
to g_signal_connect_object
with the G_CONNECT_SWAPPED
flag seems to fix the issue.
However, there are a couple more things I think worth considering before the MR is ready:
- According to the documentation for
g_signal_connect_object
,
"When the gobject is destroyed the signal handler will be automatically disconnected".
Does this mean that thunar/thunar-windows.c:1487 is redundant now, since the signal handlers should be automatically disconnected when the label is destroyed?
-
@Tamaranch mentioned the
gboolean
return type onthunar_window_notebook_update_title
not being standard, should this be switched to avoid
as specified here? It also mentioned aGParamSpec
parameter that isn't being used by the function, is this alright? -
Currently the function uses _thunar_return_val_if_fail to return early in case the window check fails. This macro is only defined if debugging is enabled. Should it instead use
g_return_val_if_fail
(org_return_if_fail
in case the function's return is changed tovoid
), so that it's always defined?