Properly destroy objects when application pauses
Fix cube example in response of new API