Merge "Check before closing the CloseGuard if not closed yet" into qt-dev