import QtQuick 2.0 import QtQuick.Dialogs 1.0 import QtQuick.Controls 1.1 Rectangle { width: 360 height: 360 Button { id: crashBtn text: "crash me!" anchors.top: parent.top onClicked: crashMe() } function crashMe(){ var data = []; for (var i = 0; i < 1000; i++) { data[i] = {display: 10*Math.random()}; } data.sort(function(a, b) { // if variables are not reused, but copied, it does not crash a = Math.sin(a.val); b = Math.sin(b.val); return a === b ? 0 : a > b ? 1 : -1; }); } }