Changeset 2899


Ignore:
Timestamp:
06/20/07 11:02:37 (12 years ago)
Author:
sorber
Message:

Corrected over-synchronization causing deadlock.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/loci/visbio/overlays/OverlayNodedObject.java

    r2896 r2899  
    167167    // NOTE: Not exactly consistent with the other overlay objects. 
    168168    // You want to see 1-node objects while drawing, but 
    169     // want to delete them if after drawing is done. 
     169    // want to delete them after drawing is done. 
    170170  } 
    171171 
     
    604604    OverlayFreeform f1 = null, f2 = null; 
    605605 
     606    float[][] f1Nodes = null, f2Nodes = null; 
     607 
    606608    synchronized (nodesSync) { 
    607609      // compute indices into the node array of this freeform  
     
    621623      // create new object if number of nodes in object > 1 
    622624      if (numNodes1 > 1) { 
    623         float[][] f1Nodes = new float[2][numNodes1]; 
     625        f1Nodes = new float[2][numNodes1]; 
    624626 
    625627        for (int i=0; i<2; i++) { 
    626628          System.arraycopy(nodes[i], 0, f1Nodes[i], 0, numNodes1); 
    627629        } 
    628  
    629         f1 = new OverlayFreeform(overlay, f1Nodes); 
    630         overlay.addObject(f1); 
    631         f1.setSelected(false); 
    632         f1.setDrawing(false); 
    633630      } 
    634631 
    635632      // create new object if number of nodes in object > 1 
    636633      if (numNodes2 > 1) { 
    637         float[][] f2Nodes = new float[2][numNodes2]; 
     634        f2Nodes = new float[2][numNodes2]; 
    638635 
    639636        for (int i = 0; i<2; i++) { 
    640637          System.arraycopy(nodes[i], f2Start, f2Nodes[i], 0, numNodes2); 
    641638        } 
    642  
    643         f2 = new OverlayFreeform(overlay, f2Nodes); 
    644         overlay.addObject(f2); 
    645         f2.setSelected(false); 
    646         f2.setDrawing(false); 
    647       } 
    648  
     639      } 
    649640    } // end synchronized 
     641 
     642    if (f1Nodes != null) { 
     643      f1 = new OverlayFreeform(overlay, f1Nodes); 
     644      overlay.addObject(f1); 
     645      f1.setSelected(false); 
     646      f1.setDrawing(false); 
     647    } 
     648    if (f2Nodes != null) { 
     649      f2 = new OverlayFreeform(overlay, f2Nodes); 
     650      overlay.addObject(f2); 
     651      f2.setSelected(false); 
     652      f2.setDrawing(false); 
     653    } 
    650654 
    651655    // dispose of original freeform 
Note: See TracChangeset for help on using the changeset viewer.