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
parent
commit
1c8e31279e
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      src/components/base/Box/index.js
  2. 10
      src/main/bridge.js
  3. 3
      src/renderer/events.js

6
src/components/base/Box/index.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,
}

10
src/main/bridge.js

@ -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,

3
src/renderer/events.js

@ -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')

Loading…
Cancel
Save