From: Cheng Zhao Date: Mon, 26 Oct 2015 08:48:27 +0000 (+0800) Subject: Fix calling showItemInFolder in renderer X-Git-Tag: v0.34.2~19^2 X-Git-Url: http://git.khamidou.com/?a=commitdiff_plain;h=f399f50e9ee11f51a2d02eeef3eb1672e95434bc;p=electron.git Fix calling showItemInFolder in renderer The remote method always assumes the existence of the remote object but doesn't keep a reference to it, so if we only keep the reference of a remote method we will get into troubles once the remote object is garbage collected. We should probably fix this in remote module, but since most things are already working quite good, I'm using the work-around for now. Fix #3139. --- diff --git a/atom/common/api/lib/shell.coffee b/atom/common/api/lib/shell.coffee index 8e06826f..bd7109e3 100644 --- a/atom/common/api/lib/shell.coffee +++ b/atom/common/api/lib/shell.coffee @@ -1,4 +1,5 @@ module.exports = process.atomBinding 'shell' if process.platform is 'win32' and process.type is 'renderer' - module.exports.showItemInFolder = require('remote').process.atomBinding('shell').showItemInFolder + module.exports.showItemInFolder = (item) -> + require('remote').require('shell').showItemInFolder item