Skip to content

Commit becc989

Browse files
committed
fixing memory leaks
1 parent 8f084d5 commit becc989

12 files changed

Lines changed: 1081 additions & 1329 deletions

File tree

src/broker/Broker.js

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import Emitter from "../core/Emitter.js";
2+
import EventData from "../core/EventData.js";
23

34
/**
45
* The Broker Class
@@ -227,15 +228,10 @@ export default class Broker {
227228

228229
this.#logs[event] = this.#logs[event] ?? [];
229230
this.#logs[event].push({ timestamp: currentTime(), args: args });
230-
231-
// Import EventData dynamically or assume it's available?
232-
// In original code: args.push(new OpenScript.EventData().encode());
233-
// I'll assume EventData is imported or I'll just skip this for now.
234-
// Wait, I should import EventData.
235231

236-
// if (args.length == 0) {
237-
// args.push(new OpenScript.EventData().encode());
238-
// }
232+
if (args.length == 0) {
233+
args.push((new EventData()).encode());
234+
}
239235

240236
args.push(event);
241237

0 commit comments

Comments
 (0)