Memory leak

Fix viewer memory leak whereby background measurements weren't being
cleared between data loads, so eventually ran out of memory.
This commit is contained in:
Douglas Gillespie 2022-11-11 20:58:42 +00:00
parent 4f734b7775
commit 3b053ff342
3 changed files with 10 additions and 3 deletions

View File

@ -4,7 +4,7 @@
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<groupId>org.pamguard</groupId> <groupId>org.pamguard</groupId>
<artifactId>Pamguard</artifactId> <artifactId>Pamguard</artifactId>
<version>2.02.05</version> <version>2.02.05a</version>
<name>Pamguard Java12+</name> <name>Pamguard Java12+</name>
<description>Pamguard for Java 12+, using Maven to control dependcies</description> <description>Pamguard for Java 12+, using Maven to control dependcies</description>
<url>www.pamguard.org</url> <url>www.pamguard.org</url>

View File

@ -31,12 +31,12 @@ public class PamguardVersionInfo {
* Version number, major version.minorversion.sub-release. * Version number, major version.minorversion.sub-release.
* Note: can't go higher than sub-release 'f' * Note: can't go higher than sub-release 'f'
*/ */
static public final String version = "2.02.05"; static public final String version = "2.02.05a";
/** /**
* Release date * Release date
*/ */
static public final String date = "21 October 2022"; static public final String date = "11 November 2022";
// /** // /**
// * Release type - Beta or Core // * Release type - Beta or Core

View File

@ -65,6 +65,7 @@ import PamDetection.LocalisationInfo;
import PamUtils.PamCalendar; import PamUtils.PamCalendar;
import PamUtils.PamUtils; import PamUtils.PamUtils;
import PamView.symbol.PamSymbolManager; import PamView.symbol.PamSymbolManager;
import PamguardMVC.background.BackgroundDataBlock;
import PamguardMVC.background.BackgroundManager; import PamguardMVC.background.BackgroundManager;
import PamguardMVC.dataOffline.OfflineDataLoadInfo; import PamguardMVC.dataOffline.OfflineDataLoadInfo;
import PamguardMVC.dataOffline.OfflineDataLoading; import PamguardMVC.dataOffline.OfflineDataLoading;
@ -944,6 +945,12 @@ public class PamDataBlock<Tunit extends PamDataUnit> extends PamObservable {
recycledUnits.clear(); recycledUnits.clear();
} }
} }
if (backgroundManager != null) {
BackgroundDataBlock bdb = backgroundManager.getBackgroundDataBlock();
if (bdb != null) {
bdb.clearAll();
}
}
} }
/** /**