Skip to content

Commit

Permalink
[!] Electron Close 시 error / 계속 checkInitialData 진행되는 문제 수정
Browse files Browse the repository at this point in the history
- Electron Close 찰나에 WebContents 오브젝트 사용하여 발생한 에러 수정
- serialPort 를 source 로 바꿨음에도 sp 의 이벤트만 삭제해서 발생한 에러
  수정
  • Loading branch information
extracold1209 committed Apr 3, 2019
1 parent 1e86966 commit 8a36164
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/custom_modules/router/scanner/serial.js
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,7 @@ Scanner.prototype.scan = function (serialport, extension, config, callback) {

var result = extension.checkInitialData(data, config);
if (result !== undefined) {
source.removeAllListeners('data');
sp.removeAllListeners('data');
clearTimeout(flashFirmware);
if (result === true) {
Expand Down
4 changes: 3 additions & 1 deletion app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,9 @@ if (!app.requestSingleInstanceLock()) {
let requestLocalDataInterval = -1;
ipcMain.on('startRequestLocalData', function(event, duration) {
requestLocalDataInterval = setInterval(() => {
event.sender.send('sendingRequestLocalData');
if (!event.sender.isDestroyed()) {
event.sender.send('sendingRequestLocalData');
}
}, duration);
});
ipcMain.on('stopRequestLocalData', function() {
Expand Down

0 comments on commit 8a36164

Please sign in to comment.