Ticket #13466: patch-test-performacne-renderer-memleak.patch

File patch-test-performacne-renderer-memleak.patch, 3.0 KB (added by michael2402, 8 years ago)
  • test/performance/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRendererPerformanceTestParent.java

    diff --git a/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRendererPerformanceTestParent.java b/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/AbstractMapRendererPerformanceTestParent.java
    index 569c6a0..63b5f74 100644
    a b public abstract class AbstractMapRendererPerformanceTestParent {  
    7171        }
    7272    }
    7373
     74    protected static void clean() throws Exception {
     75        g = null;
     76        img = null;
     77        nc = null;
     78        dsRestriction = null;
     79        dsMultipolygon = null;
     80        dsCity = null;
     81    }
     82
    7483    protected abstract Rendering buildRenderer();
    7584
    7685    protected final void test(int iterations, DataSet ds, Bounds bounds) throws Exception {
  • test/performance/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRendererPerformanceTest.java

    diff --git a/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRendererPerformanceTest.java b/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/StyledMapRendererPerformanceTest.java
    index 018bfd0..cf7940d 100644
    a b import java.io.IOException;  
    66
    77import javax.imageio.ImageIO;
    88
     9import org.junit.AfterClass;
    910import org.junit.BeforeClass;
    1011import org.openstreetmap.josm.gui.mappaint.MapPaintStyles;
    1112
    public class StyledMapRendererPerformanceTest extends AbstractMapRendererPerform  
    2324        MapPaintStyles.readFromPreferences();
    2425    }
    2526
     27    @AfterClass
     28    public static void clean() throws Exception {
     29        AbstractMapRendererPerformanceTestParent.clean();
     30    }
     31
    2632    @Override
    2733    protected Rendering buildRenderer() {
    2834        return new StyledMapRenderer(g, nc, false);
  • test/performance/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRendererPerformanceTest.java

    diff --git a/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRendererPerformanceTest.java b/test/performance/org/openstreetmap/josm/data/osm/visitor/paint/WireframeMapRendererPerformanceTest.java
    index 75f74d3..7549d9e 100644
    a b  
    11// License: GPL. For details, see LICENSE file.
    22package org.openstreetmap.josm.data.osm.visitor.paint;
    33
     4import org.junit.AfterClass;
    45import org.junit.BeforeClass;
    56
    67/**
    public class WireframeMapRendererPerformanceTest extends AbstractMapRendererPerf  
    1314        AbstractMapRendererPerformanceTestParent.load();
    1415    }
    1516
     17    @AfterClass
     18    public static void clean() throws Exception {
     19        AbstractMapRendererPerformanceTestParent.clean();
     20    }
     21
    1622    @Override
    1723    protected Rendering buildRenderer() {
    1824        return new WireframeMapRenderer(g, nc, false);