This helps the window to be only a glue in between the actual UI elements instead of handling a lot of the UI.
Replace it by g_clear_object() as it does the same thing.