Fixes leaking HistoryWindows.