Browse Source
Merge pull request #74 from meriadec/master
Prevent zombie processes in dev, remove unused GrowScroll
master
Loëck Vézien
7 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with
13 additions and
6 deletions
-
src/components/base/Box/index.js
-
src/main/bridge.js
-
src/renderer/events.js
|
|
@ -77,12 +77,6 @@ Card.defaultProps = { |
|
|
|
title: undefined, |
|
|
|
} |
|
|
|
|
|
|
|
export const GrowScroll = (props: *) => ( |
|
|
|
<Box grow relative> |
|
|
|
<Box sticky scroll {...props} /> |
|
|
|
</Box> |
|
|
|
) |
|
|
|
|
|
|
|
type TabbableState = { |
|
|
|
isFocused: boolean, |
|
|
|
} |
|
|
|
|
|
@ -7,6 +7,12 @@ import { resolve } from 'path' |
|
|
|
|
|
|
|
import setupAutoUpdater, { quitAndInstall } from './autoUpdate' |
|
|
|
|
|
|
|
const processes = [] |
|
|
|
|
|
|
|
function cleanProcesses() { |
|
|
|
processes.forEach(kill => kill()) |
|
|
|
} |
|
|
|
|
|
|
|
function onForkChannel(forkType, callType) { |
|
|
|
return (event: any, payload) => { |
|
|
|
const { type, data } = payload |
|
|
@ -24,6 +30,8 @@ function onForkChannel(forkType, callType) { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
processes.push(kill) |
|
|
|
|
|
|
|
const onMessage = payload => { |
|
|
|
const { type, data, options = {} } = payload |
|
|
|
if (callType === 'async') { |
|
|
@ -48,6 +56,8 @@ function onForkChannel(forkType, callType) { |
|
|
|
ipcMain.on('usb', onForkChannel('usb', 'async')) |
|
|
|
ipcMain.on('accounts', onForkChannel('accounts', 'async')) |
|
|
|
|
|
|
|
ipcMain.on('clean-processes', cleanProcesses) |
|
|
|
|
|
|
|
const handlers = { |
|
|
|
updater: { |
|
|
|
init: setupAutoUpdater, |
|
|
|
|
|
@ -120,6 +120,9 @@ export default ({ store, locked }: { store: Object, locked: boolean }) => { |
|
|
|
handler(data) |
|
|
|
}) |
|
|
|
|
|
|
|
// Ensure all sub-processes are killed before creating new ones (dev mode...)
|
|
|
|
ipcRenderer.send('clean-processes') |
|
|
|
|
|
|
|
// Start detection when we plug/unplug devices
|
|
|
|
sendEvent('usb', 'devices.listen') |
|
|
|
|
|
|
|