Skip to content
  • Cosimo Cecchi's avatar
    windowAttentionHandler: disconnect signals before destruction · 6359d6ef
    Cosimo Cecchi authored
    The 'destroy' signal is emitted at the end of the destroy() method.
    However the implementation of destroy() can end up emitting one of the
    signals we connect to on the window, causing us to re-enter destroy
    from its callback.
    That will in turn lead to some objects getting disposed twice, which
    produces a stack trace like the following one.
    
    This commit fixes the issue by overriding the destroy() method instead
    of connecting to the signal, which allows us to disconnect the signal
    handlers from the window at an earlier time and avoid re-entrancy.
    
    --
    
    gnome-shell[1082]: Object Gio.Settings (0x7f0af8143f00), has been already deallocated — impossible to access it. This might be caused by the object having been destroyed from C code using something such as destroy(), dispose(), or remove() vfuncs.
    org.gnome.Shell.desktop[1082]: == Stack trace for context 0x5627f7d1e220 ==
    org.gnome.Shell.desktop[1082]: #0   5627f9e801a8 i   resource:///org/gnome/s...
    6359d6ef