Make sure deleteLater gets run at the "correct" time.
Make sure deleteLater gets run at the "correct" time.

We have a number of places where we delete scene graph objects with
deleteLater() and change the scene graph. The timing of when the
deleteLater happens is very important as we need to complete
the updates to the scene graph first.

In this particular case, a QQuickShaderEffectSource was released,
and an update was scheduled but because animations were running we
were already beginning to render a new frame before the update was
handled, causing a crash.

The only safe place to run deferred deletes is after we have
performed a proper sync with the item scene.

Task-number: QTBUG-29485
Change-Id: I6e93d4e6276fe82d3f4c818781b188e03c46e510
Reviewed-by: Samuel Rødal <99126055f8d73e4355b075213322026fa8c060bd@digia.com>

corngood/qtdeclarative,matthewvogt/qtdeclarative,corngood/qtdeclarative,jfaust/qtdeclarative,jfaust/qtdeclarative,corngood/qtdeclarative,corngood/qtdeclarative,jfaust/qtdeclarative,qmlc/qtdeclarative,mgrunditz/qtdeclarative-2d,jfaust/qtdeclarative,qmlc/qtdeclarative,matthewvogt/qtdeclarative,corngood/qtdeclarative,corngood/qtdeclarative,mgrunditz/qtdeclarative-2d,matthewvogt/qtdeclarative,mgrunditz/qtdeclarative-2d,qmlc/qtdeclarative,matthewvogt/qtdeclarative,mgrunditz/qtdeclarative-2d,mgrunditz/qtdeclarative-2d,jfaust/qtdeclarative,mgrunditz/qtdeclarative-2d,matthewvogt/qtdeclarative,matthewvogt/qtdeclarative,jfaust/qtdeclarative,qmlc/qtdeclarative,qmlc/qtdeclarative,matthewvogt/qtdeclarative,mgrunditz/qtdeclarative-2d,qmlc/qtdeclarative,matthewvogt/qtdeclarative,qmlc/qtdeclarative,qmlc/qtdeclarative,corngood/qtdeclarative,jfaust/qtdeclarative