Fixed Qt4 crash on close.