Skip to content

Commit 8b03408

Browse files
committed
Centralize timer cleanup
1 parent 20f3c6a commit 8b03408

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/js/msp.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,11 @@ const MSP = {
480480
},
481481

482482
_removeRequestFromCallbacks(requestObj) {
483+
// Clear the timer if it exists
484+
if (requestObj.timer) {
485+
clearTimeout(requestObj.timer);
486+
}
487+
483488
const index = this.callbacks.indexOf(requestObj);
484489
if (index > -1) {
485490
this.callbacks.splice(index, 1);

0 commit comments

Comments
 (0)