Changeset 1440 in josm


Ignore:
Timestamp:
2009-02-24T18:25:35+01:00 (10 years ago)
Author:
stoecker
Message:

close #2230. patch by xeen

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/MapFrame.java

    r1415 r1440  
    144144        // remove menu entries
    145145        Main.main.menu.viewMenu.setVisible(false);
     146       
     147        // MapFrame gets destroyed when the last layer is removed, but the status line background
     148        // thread that collects the information doesn't get destroyed automatically.
     149        if(statusLine.thread == null) return;
     150        try {
     151            statusLine.thread.interrupt();
     152        } catch (Exception e) {}
    146153    }
    147154
  • trunk/src/org/openstreetmap/josm/gui/MapStatus.java

    r1415 r1440  
    100100    ImageLabel distText = new ImageLabel("dist", tr("The length of the new way segment being drawn."), 8);
    101101
     102    /**
     103     * This is the thread that runs in the background and collects the information displayed.
     104     * It gets destroyed by MapFrame.java/destroy() when the MapFrame itself is destroyed.
     105     */
     106    public Thread thread;
     107   
    102108    /**
    103109     * The collector class that waits for notification and then update
     
    294300        // The background thread
    295301        final Collector collector = new Collector(mapFrame);
    296         new Thread(collector).start();
     302        thread = new Thread(collector, "Map Status Collector");
     303        thread.setDaemon(true);
     304        thread.start();
    297305
    298306        // Listen to keyboard/mouse events for pressing/releasing alt key and
     
    345353        return "Statusline";
    346354    }
    347    
     355       
    348356    @Override
    349357    public void addMouseListener(MouseListener ml) {
  • trunk/src/org/openstreetmap/josm/tools/XmlObjectParser.java

    r1403 r1440  
    197197
    198198    public Iterable<Object> start(final Reader in) {
    199         new Thread(){
     199        new Thread("XML Reader"){
    200200            @Override public void run() {
    201201                try {
Note: See TracChangeset for help on using the changeset viewer.