Some more memory cleanup

This commit is contained in:
nathan 2025-02-20 17:27:25 -07:00
parent 0e15989eda
commit 73f30a94b1
5 changed files with 26 additions and 7 deletions

View File

@ -576,5 +576,5 @@ window.nm_hide_popup = function(element, div_id)
*/ */
window.nm_activate_link = function(_action, _senders) window.nm_activate_link = function(_action, _senders)
{ {
jQuery(_senders[0].iface.getDOMNode()).find('.et2_clickable:first').trigger('click'); _senders[0].iface.getDOMNode().querySelector('.et2_clickable').dispatchEvent(new Event('click'));
} }

View File

@ -65,6 +65,7 @@ export class et2_nextmatch_rowProvider
this._subgridCallback = null; this._subgridCallback = null;
this._context = null; this._context = null;
this._rootWidget = null; this._rootWidget = null;
this._template.seperated = null;
this._template = null; this._template = null;
this._dataRow = null; this._dataRow = null;
} }

View File

@ -62,6 +62,7 @@
if (this.sidemenuEntry) this.sidemenuEntry.remove(); if (this.sidemenuEntry) this.sidemenuEntry.remove();
delete this.sidemenuEntry; delete this.sidemenuEntry;
delete this.browser; delete this.browser;
delete this.parentFw;
delete (framework.applications[this.appName]); delete (framework.applications[this.appName]);
}; };

View File

@ -174,6 +174,22 @@ window.app = {classes: {}};
window.egw.top = window; window.egw.top = window;
} }
// Register unload listener for cleanup
if (popup)
{
// Uncomment this to debug pagehide events
// window.onpagehide = (e) => { debugger;};
window.addEventListener("pagehide", (e) =>
{
if (window.framework)
{
window.framework.popup_close(window);
}
window.framework = null;
window.egw = null;
})
}
// focus window / call window.focus(), if data-window-focus is specified // focus window / call window.focus(), if data-window-focus is specified
var window_focus = egw_script.getAttribute('data-window-focus'); var window_focus = egw_script.getAttribute('data-window-focus');
if (window_focus && JSON.parse(window_focus)) if (window_focus && JSON.parse(window_focus))

View File

@ -26,22 +26,23 @@ egw.extend('tooltip', egw.MODULE_WND_LOCAL, function(_app, _wnd)
"use strict"; "use strict";
const tooltipped = []; const tooltipped = [];
_wnd.addEventListener("unload", (e) => let tooltip_div = null;
let current_elem = null;
_wnd.addEventListener("pagehide", () =>
{ {
tooltipped.forEach(node => tooltipped.forEach(node =>
{ {
egw.tooltipUnbind(node); egw.tooltipUnbind(node);
}); });
tooltipped.splice(0, tooltipped.length); tooltipped.splice(0, tooltipped.length);
if (tooltip_div && tooltipped_div.off) if (tooltip_div && tooltip_div.off)
{ {
tooltipped_div.off(); tooltip_div.off();
tooltip_div = null;
} }
return null; return null;
}) })
let tooltip_div = null;
let current_elem = null;
const time_delta = 100; const time_delta = 100;
let show_delta = 0; let show_delta = 0;
@ -152,7 +153,7 @@ egw.extend('tooltip', egw.MODULE_WND_LOCAL, function(_app, _wnd)
jQuery(_wnd.document.body).append(tooltip_div); jQuery(_wnd.document.body).append(tooltip_div);
//The tooltip should automatically hide when the mouse comes over it //The tooltip should automatically hide when the mouse comes over it
tooltip_div.on("mouseenter.tooltip", function () tooltip_div.get(0).addEventListener("mouseover", () =>
{ {
if (_options.hideonhover) hide(); if (_options.hideonhover) hide();
}); });