Skip to content

Commit

Permalink
Fixed race condition
Browse files Browse the repository at this point in the history
  • Loading branch information
mireq committed Feb 7, 2015
1 parent a46bc65 commit b64a7b2
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion qml/Btn.qml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ Button {
interval: 40

onTriggered: {
if (buttonPreview !== null) {
buttonPreview.destroy();
buttonPreview = null;
}
buttonPreview = buttonPreviewComponent.createObject(keyboardOverlay, {"btn": btn, "content": typeof(content) == "undefined" ? undefined: content, "keyboard": keyboard});
}
}
Expand All @@ -60,11 +64,11 @@ Button {
createPreviewTimer.restart();
}
else {
createPreviewTimer.stop();
if (buttonPreview !== null) {
buttonPreview.destroy();
buttonPreview = null;
}
createPreviewTimer.stop();
}
}
}

0 comments on commit b64a7b2

Please sign in to comment.