8000 Mitigate event emitter "memory leak" warnings when a significant numb… · homebridge/HAP-NodeJS@279a86c · GitHub
[go: up one dir, main page]

Skip to content

Commit 279a86c

Browse files
committed
Mitigate event emitter "memory leak" warnings when a significant number of HomeKit camera streaming events occur simultaneously. (#1037)
1 parent f18f7d5 commit 279a86c

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22

33
All notable changes to `hap-nodejs` will be documented in this file. This project tries to adhere to [Semantic Versioning](http://semver.org/).
44

5+
## v0.13.0 (Unreleased)
6+
7+
### Changed
8+
9+
- Mitigate event emitter "memory leak" warnings when a significant number of HomeKit camera streaming events occur simultaneously. (#1037)
10+
511
## v0.12.3 (2024-10-26)
612

713
### Changed

src/lib/camera/RTPStreamManagement.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -784,6 +784,7 @@ export class RTPStreamManagement {
784784

785785
if (this.activeConnection) {
786786
this.activeConnection.removeListener(HAPConnectionEvent.CLOSED, this.activeConnectionClosedListener);
787+
this.activeConnection.setMaxListeners(this.activeConnection.getMaxListeners() - 1);
787788
this.activeConnection = undefined;
788789
}
789790

@@ -1098,6 +1099,7 @@ export class RTPStreamManagement {
10981099
"Found non-nil `activeConnection` when trying to setup streaming endpoints, even though streamStatus is reported to be AVAILABLE!");
10991100

11001101
this.activeConnection = connection;
1102+
this.activeConnection.setMaxListeners(this.activeConnection.getMaxListeners() + 1);
11011103
this.activeConnection.on(HAPConnectionEvent.CLOSED, this.activeConnectionClosedListener);
11021104

11031105
// noinspection JSDeprecatedSymbols

0 commit comments

Comments
 (0)
0