From: Cheng Zhao Date: Wed, 19 Feb 2014 11:39:01 +0000 (+0000) Subject: linux: Fix crash when using protocol module early. X-Git-Tag: v0.10.0~6^2~18 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=0a9c371ca28f9a99054e72caa57bc2e59719ffea;p=electron.git linux: Fix crash when using protocol module early. --- diff --git a/browser/api/atom_api_protocol.cc b/browser/api/atom_api_protocol.cc index 107477d0..1499f38c 100644 --- a/browser/api/atom_api_protocol.cc +++ b/browser/api/atom_api_protocol.cc @@ -368,6 +368,12 @@ void Protocol::Initialize(v8::Handle target) { // Remember the protocol object, used for emitting event later. g_protocol_object.reset(target); +#if defined(OS_LINUX) + // Make sure the job factory has been created. + AtomBrowserContext::Get()->url_request_context_getter()-> + GetURLRequestContext(); +#endif + NODE_SET_METHOD(target, "registerProtocol", RegisterProtocol); NODE_SET_METHOD(target, "unregisterProtocol", UnregisterProtocol); NODE_SET_METHOD(target, "isHandledProtocol", IsHandledProtocol);