Bug 1201598 Comment 11 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

(In reply to Gabriele Svelto [:gsvelto] from comment #7)
> FYI I think I've narrowed down the issue but I'm still extremely puzzled by it. If I do the following on a MIDIInput object:
> ```javascript
> input.onmidimessage = (event) => { /* do stuff */ };
> ```
> The event handler is called but the object is not kept alive unless I have another reference to it. On the other hand if I do this:
Sounds like some issue in the midi implementation, someone isn't keeping a strong reference to the object.

> ```javascript
> input.addEventHandler("midimessage", (event) => { /* do stuff */ });
> ```

There is no such thing as addEventHandler. It is addEventListener
(In reply to Gabriele Svelto [:gsvelto] from comment #7)
> FYI I think I've narrowed down the issue but I'm still extremely puzzled by it. If I do the following on a MIDIInput object:
> ```javascript
> input.onmidimessage = (event) => { /* do stuff */ };
> ```
> The event handler is called but the object is not kept alive unless I have another reference to it. On the other hand if I do this:

Sounds like some issue in the midi implementation, someone isn't keeping a strong reference to the object.

> ```javascript
> input.addEventHandler("midimessage", (event) => { /* do stuff */ });
> ```

There is no such thing as addEventHandler. It is addEventListener

Back to Bug 1201598 Comment 11