fix segfault when opening trash, then closing the window