mirror of
https://github.com/ckb-next/ckb-next.git
synced 2026-10-12 21:37:20 -04:00
Do not write to removed cmdpath
This fixes crashing with SIGPIPE on device disconnection.
This commit is contained in:
+1
-1
@@ -215,7 +215,7 @@ Kb::~Kb(){
|
||||
|
||||
// Kill notification thread and remove node
|
||||
activeDevices.remove(this);
|
||||
if(cmd.isOpen() && notifyNumber > 0){
|
||||
if(QFile::exists(cmdpath) && cmd.isOpen() && notifyNumber > 0){
|
||||
cmd.write(QString("idle\nnotifyoff %1\n").arg(notifyNumber).toLatin1());
|
||||
// Manually flush so that the daemon closes the notify pipe and the thread can gracefully stop
|
||||
cmd.flush();
|
||||
|
||||
Reference in New Issue
Block a user