Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

Prevent possible memory leak

tsareg375b145030b1
diff --git a/modules/UI/UI.js b/modules/UI/UI.js
index c3d6f97a7d..fc72facb08 100644
--- a/modules/UI/UI.js
+++ b/modules/UI/UI.js
@@ -1289,6 +1289,12 @@ UI.showDeviceErrorDialog = function (micError, cameraError) {
input.prop("checked");
}
}
+ },
+ null,
+ function () {
+ // Reset dialog reference to null to avoid memory leaks when
+ // user closed the dialog manually.
+ deviceErrorDialog = null;
}
);
diff --git a/modules/UI/util/MessageHandler.js b/modules/UI/util/MessageHandler.js
index fdf2744819..bbeacb4e10 100644
--- a/modules/UI/util/MessageHandler.js
+++ b/modules/UI/util/MessageHandler.js
@@ -113,9 +113,10 @@ var messageHandler = {
* @param submitFunction function to be called on submit
* @param loadedFunction function to be called after the prompt is fully
* loaded
+ * @param closeFunction function to be called on dialog close
*/
openDialog: function (titleString, msgString, persistent, buttons,
- submitFunction, loadedFunction) {
+ submitFunction, loadedFunction, closeFunction) {
if (!popupEnabled)
return;
@@ -125,11 +126,14 @@ var messageHandler = {
buttons: buttons,
defaultButton: 1,
loaded: loadedFunction,
- submit: submitFunction
+ submit: submitFunction,
+ close: closeFunction
};
+
if (persistent) {
args.closeText = '';
}
+
return new Impromptu(msgString, args);
},