fix crash in windows launcher
This commit is contained in:
@@ -29,8 +29,14 @@ namespace OpenRA.Launcher
|
||||
}
|
||||
Dictionary<string, Download> downloads = new Dictionary<string,Download>();
|
||||
|
||||
readonly Control hostControl;
|
||||
HtmlDocument document = null;
|
||||
|
||||
public JSBridge(Control hostControl)
|
||||
{
|
||||
this.hostControl = hostControl;
|
||||
}
|
||||
|
||||
public HtmlDocument Document
|
||||
{
|
||||
get { return document; }
|
||||
@@ -177,7 +183,7 @@ namespace OpenRA.Launcher
|
||||
using (var reader = new StreamReader(pipe))
|
||||
{
|
||||
var data = reader.ReadToEnd();
|
||||
Form.ActiveForm.Invoke((Delegate)(Action)(() =>
|
||||
hostControl.Invoke((Delegate)(Action)(() =>
|
||||
document.InvokeScript(callbackName, new object[] { data })));
|
||||
}
|
||||
}, url);
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace OpenRA.Launcher
|
||||
|
||||
Util.UacShield(installButton);
|
||||
|
||||
webBrowser.ObjectForScripting = new JSBridge();
|
||||
webBrowser.ObjectForScripting = new JSBridge(this);
|
||||
webBrowser.DocumentCompleted += (o, e) =>
|
||||
{
|
||||
var b = o as WebBrowser;
|
||||
|
||||
Reference in New Issue
Block a user