mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Fix crash when using protocol module on startup.
The job factory was not created before any request was sent, so when the app used the protocol module on startup it would cause a crash.
This commit is contained in:
@@ -75,6 +75,11 @@ void AtomBrowserMainParts::PreMainMessageLoopRun() {
|
||||
|
||||
node_bindings_->RunMessageLoop();
|
||||
|
||||
// Make sure the url request job factory is created before the
|
||||
// will-finish-launching event.
|
||||
static_cast<content::BrowserContext*>(AtomBrowserContext::Get())->
|
||||
GetRequestContext();
|
||||
|
||||
#if !defined(OS_MACOSX)
|
||||
// The corresponding call in OS X is in AtomApplicationDelegate.
|
||||
Browser::Get()->WillFinishLaunching();
|
||||
|
||||
@@ -35,6 +35,9 @@ app.on('window-all-closed', function() {
|
||||
});
|
||||
|
||||
app.on('finish-launching', function() {
|
||||
// Test if using protocol module would crash.
|
||||
require('protocol').registerProtocol('test-if-crashes', function() {});
|
||||
|
||||
window = new BrowserWindow({
|
||||
title: 'atom-shell tests',
|
||||
show: false,
|
||||
|
||||
Reference in New Issue
Block a user