on xenial help sign in
Hotfix around unloading WebView in wizard on first boot, which seems to cause a freeze due to oxide memory corruption, we think
29849b8Michael Terry
qml/Wizard/Pages/75-report-check.qml+13−2
@@ -63,18 +63,29 @@ LocalComponents.Page {
63 onLinkActivated: {
63 onLinkActivated: {
64 webview.url = "http://www.ubuntu.com/legal/terms-and-policies/privacy-policy";
64 webview.url = "http://www.ubuntu.com/legal/terms-and-policies/privacy-policy";
65 webview.visible = true;
65 webview.visible = true;
66+ webview.active = true;
66 }
67 }
67 }
68 }
68
69
69− WebView {
70+ // FIXME: we use a loader, because we're seeing freezes in unity8 after
71+ // wizard shuts down, seemingly due to oxide? So for now, as a hotfix,
72+ // we only load the webview when necessary.
73+ // Also see Wizard.qml, where we avoid unloading the wizard at all for
74+ // similar mitigation reasons while we root-cause the problem.
75+ Loader {
70 id: webview
76 id: webview
71− objectName: "webview"
72 anchors.left: parent.left
77 anchors.left: parent.left
73 anchors.right: parent.right
78 anchors.right: parent.right
74 anchors.leftMargin: -leftMargin
79 anchors.leftMargin: -leftMargin
75 anchors.rightMargin: -rightMargin
80 anchors.rightMargin: -rightMargin
76 height: parent.height
81 height: parent.height
77 visible: false
82 visible: false
83+ active: false
84+ property string url
85+ sourceComponent: WebView {
86+ objectName: "webview"
87+ url: webview.url
88+ }
78 }
89 }
79 }
90 }
80
91
qml/Wizard/Wizard.qml+11−2
@@ -27,7 +27,7 @@ Showable {
27 // changing values. Having it cached as a proper Qml bool property prevents
27 // changing values. Having it cached as a proper Qml bool property prevents
28 // unnecessary 'changed' emissions and provides consuming classes the
28 // unnecessary 'changed' emissions and provides consuming classes the
29 // expected behavior of no emission on startup.
29 // expected behavior of no emission on startup.
30− readonly property bool active: loader.active
30+ readonly property bool active: System.wizardEnabled
31
31
32 hideAnimation: StandardAnimation { property: "opacity"; to: 0 }
32 hideAnimation: StandardAnimation { property: "opacity"; to: 0 }
33
33
@@ -37,11 +37,20 @@ Showable {
37 }
37 }
38 }
38 }
39
39
40+ // FIXME: we make active state a one way road, because we're seeing freezes
41+ // in unity8 after wizard shuts down, seemingly due to oxide? So for now,
42+ // as a hotfix, just don't shut the wizard memory down.
43+ // Also see 75-report-check.qml, where we avoid unloading the wizard at all
44+ // for similar mitigation reasons while we root-cause the problem.
45+ onActiveChanged: if (active) loader.active = true
46+ Component.onCompleted: if (active) loader.active = true
47+
40 Loader {
48 Loader {
41 id: loader
49 id: loader
42 anchors.fill: parent
50 anchors.fill: parent
43− active: System.wizardEnabled
51+ active: false
44 source: "Pages.qml"
52 source: "Pages.qml"
53+ visible: root.visible && root.active
45
54
46 Connections {
55 Connections {
47 target: loader.item
56 target: loader.item