Prevent possible memory leak
This commit is contained in:
parent
8b528b582f
commit
375b145030
|
@ -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;
|
||||
}
|
||||
);
|
||||
|
||||
|
|
|
@ -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);
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in New Issue