1
0
mirror of https://github.com/Ylianst/MeshAgent synced 2026-01-04 17:43:45 +00:00

1. Updated GenericMarshal.GlobalCallback to have a close() method, to unhook global events

2. Updated EventEmitter to delete callback references for 'once', 'removeListener', and 'removeAllListeners'
3. Updated win-message-pump to cleanup global events correctly, so object can be garbage collected
This commit is contained in:
Bryan Roe
2020-01-09 13:57:23 -08:00
parent eb257198e3
commit 981ee96ad7
5 changed files with 81 additions and 19 deletions

View File

@@ -66,6 +66,7 @@ function windows_notifybar_local(title)
this._pumps[i].removeAllListeners('exit');
this._pumps[i].close();
}
this._pumps = [];
});
ret._promise.then(function (m)
@@ -105,6 +106,7 @@ function windows_notifybar_local(title)
this.notifybar._pumps[i].close();
}
this.notifybar.emit('close');
this.notifybar._pumps = [];
});
this.notifybar._pumps.peek().on('message', function onWindowsMessage(msg)
{
@@ -132,7 +134,7 @@ function windows_notifybar_local(title)
// Allow the move, but only on the X-axis
msg.lparam_raw.Deref(12, 4).toBuffer().writeInt32LE(this._options.window.y);
}
break;
break;
case 8:
flags = msg.lparam_raw.Deref(32, 4).toBuffer().readUInt32LE() | 0x0002 // Set SWP_NOMOVE
if (msg.lparam_raw.Deref(16, 4).toBuffer().readInt32LE() < this._options.window.left ||