fix releaseMem ...
this time without flashing icons
This commit is contained in:
@@ -967,7 +967,7 @@ PlaneObject.prototype.updateIcon = function() {
|
||||
|
||||
let styleKey = (webgl ? '' : svgKey) + '!' + labelText + '!' + this.scale;
|
||||
|
||||
if (this.styleKey != styleKey) {
|
||||
if (this.styleKey != styleKey || !this.marker.getStyle()) {
|
||||
this.styleKey = styleKey;
|
||||
let style;
|
||||
if (labelText) {
|
||||
@@ -1667,10 +1667,14 @@ PlaneObject.prototype.clearMarker = function() {
|
||||
PlaneIconFeatures.removeFeature(this.marker);
|
||||
this.marker.visible = false;
|
||||
}
|
||||
delete this.marker;
|
||||
if (this.glMarker && this.glMarker.visible) {
|
||||
webglFeatures.removeFeature(this.glMarker);
|
||||
this.glMarker.visible = false;
|
||||
}
|
||||
delete this.glMarker;
|
||||
delete this.styleKey;
|
||||
delete this.olPoint;
|
||||
};
|
||||
|
||||
// Update our marker on the map
|
||||
|
||||
@@ -3395,14 +3395,15 @@ function removeHighlight() {
|
||||
// OpenLayers might have some slight memory retention issues
|
||||
// recreating all OpenLayers Features for the planes every now and then releases that retained memory
|
||||
function releaseMem() {
|
||||
//console.log('releaseMem()');
|
||||
for (let i in PlanesOrdered) {
|
||||
PlanesOrdered[i].clearMarker();
|
||||
PlanesOrdered[i].destroyTrace();
|
||||
PlanesOrdered[i].destroyTR();
|
||||
}
|
||||
refreshFeatures();
|
||||
mapRefresh(true);
|
||||
TAR.planeMan.redraw();
|
||||
//mapRefresh(true);
|
||||
}
|
||||
|
||||
function refreshFeatures() {
|
||||
@@ -7473,7 +7474,9 @@ function showReplayBar(){
|
||||
function timeoutFetch() {
|
||||
fetchData();
|
||||
timers.checkMove = setTimeout(timeoutFetch, Math.max(RefreshInterval, 10000));
|
||||
if (now - lastReap > 120) {
|
||||
reaper();
|
||||
}
|
||||
}
|
||||
|
||||
function handleVisibilityChange() {
|
||||
|
||||
Reference in New Issue
Block a user