Memory leaks fixed on the QT sample