Here is the patch to fix the issue, I had to move two lines to avoid a  NPE.

Paul

Index: src/com/vividsolutions/jump/workbench/ui/InfoModel.java
===================================================================
RCS file: 
/cvsroot/jump-pilot/openjump/src/com/vividsolutions/jump/workbench/ui/InfoModel.java,v
retrieving revision 1.1
diff -u -r1.1 InfoModel.java
--- src/com/vividsolutions/jump/workbench/ui/InfoModel.java     16 Jun 2005 
22:11:46 -0000      1.1
+++ src/com/vividsolutions/jump/workbench/ui/InfoModel.java     6 Jun 2007 
17:06:40 -0000
@@ -92,13 +92,13 @@
 
     public void remove(Layer layer) {
         LayerTableModel layerTableModel = getTableModel(layer);
-        ((LayerTableModel) layerToTableModelMap.get(layer)).dispose();
-        layerToTableModelMap.remove(layer);
 
         for (Iterator i = listeners.iterator(); i.hasNext();) {
             InfoModelListener listener = (InfoModelListener) i.next();
             listener.layerRemoved(layerTableModel);
         }
+        ((LayerTableModel) layerToTableModelMap.get(layer)).dispose();
+        layerToTableModelMap.remove(layer);
     }
 
     public void clear() {




Paul Austin wrote:
> In the current implementation of InfoModel.remove() it disposes of the
> LayerTableModel before it notifies the listener that it is going to be
> removed. This means that the listeners don't have access to the features
> that were being removed to do cleanup. The following line should be
> moved to the end of the method.
>
> ((LayerTableModel) layerToTableModelMap.get(layer)).dispose();
>
> What do people think?
>
> Paul
>
> -------------------------------------------------------------------------
> This SF.net email is sponsored by DB2 Express
> Download DB2 Express C - the FREE version of DB2 express and take
> control of your XML. No limits. Just data. Click to get it now.
> http://sourceforge.net/powerbar/db2/
> _______________________________________________
> Jump-pilot-devel mailing list
> Jump-pilot-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel
>   


-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Jump-pilot-devel mailing list
Jump-pilot-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jump-pilot-devel

Reply via email to