electron-17: added logic to check dev environment for crashing the renderer process

This commit is contained in:
Vishwas Shashidhar 2017-09-25 14:33:12 +05:30
parent 605c725a08
commit a647c0d3cd
2 changed files with 9 additions and 1 deletions

View File

@ -112,8 +112,14 @@ function createAPI() {
/**
* Provides API to crash the renderer process that calls this function
* Is only used for demos.
*/
crashRendererProcess: function () {
// For practical purposes, we don't allow
// this method to work in non-dev environments
if (!process.env.ELECTRON_DEV) {
return;
}
process.crash();
},

View File

@ -195,7 +195,9 @@ function doCreateMainWindow(initialUrl, initialBounds) {
if (index === 0) {
mainWindow.reload();
}
else mainWindow.close();
else {
mainWindow.close();
}
});
});