compositor: use a QPointer instead of manually handling the deletion