-
Notifications
You must be signed in to change notification settings - Fork 83
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows: Spellchecker casts new processes, that are not cleared always #83
Comments
Seeing this as well in an app I've been working on, got up to 37 processes with the app running over the course of the week, when they are running they look like the below when using electron-process-manager. They seem to be instances of |
After some more experimenting it seems to happen if the calling renderer closes before the process completes it gets stuck. |
I'm not proud of it (kind of a dirty hack and may cause issues on slow machines)... but I do have a work around for this issue that seems to work. Basically it watches in the main process for windows to be created, then waits for them to load. If when they load the url is the preloader and loading cld2.js a timer is started at double the default idle timeout (5s). If the window is still open when the timeout expires it closes it. app.on('browser-window-created', function(e, window) {
var timeout;
window.webContents.once('did-finish-load', function() {
var url=decodeURIComponent(window.webContents.getURL());
if(url.indexOf('electron-remote/lib/renderer-require-preload.html')>0 && url.indexOf('electron-spellchecker'+path.sep+'lib'+path.sep+'cld2.js')>0) {
timeout=setTimeout(function() {
if(window && !window.isDestroyed()) {
window.close();
}
}, 10000)
}
});
window.once('closed', function() {
clearTimeout(timeout);
});
}); |
We're using the default implementation of electron-spellcheker (by the book - docs) and saw that every time a word gets processed a new system process is created and it is not cleared. Those processes stay alive until the app gets shut down.
The text was updated successfully, but these errors were encountered: