Index: trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java
===================================================================
--- trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java	(revision 744)
+++ trunk/src/org/openstreetmap/josm/gui/dialogs/LayerListDialog.java	(revision 745)
@@ -22,4 +22,5 @@
 import javax.swing.JLabel;
 import javax.swing.JList;
+import javax.swing.JOptionPane;
 import javax.swing.JPanel;
 import javax.swing.JScrollPane;
@@ -69,6 +70,15 @@
 			int sel = instance.getSelectedIndex();
 			Layer l = layer != null ? layer : (Layer)instance.getSelectedValue();
-			if (l instanceof OsmDataLayer && !DontShowAgainInfo.show("delete_layer", tr("Do you really want to delete the whole layer?")))
-				return;
+			if (l instanceof OsmDataLayer)
+			{
+				if (((OsmDataLayer)l).isModified())
+				{
+					if(JOptionPane.showConfirmDialog(instance, tr("There are unsaved changes. Delete the layer anwyay?"),
+					tr("Unsaved Changes"), JOptionPane.YES_NO_OPTION) != JOptionPane.YES_OPTION)
+						return;
+				}
+				else if(!DontShowAgainInfo.show("delete_layer", tr("Do you really want to delete the whole layer?"), false))
+					return;
+			}
 			Main.main.removeLayer(l);
 			if (sel >= instance.getModel().getSize())
Index: trunk/src/org/openstreetmap/josm/tools/DontShowAgainInfo.java
===================================================================
--- trunk/src/org/openstreetmap/josm/tools/DontShowAgainInfo.java	(revision 744)
+++ trunk/src/org/openstreetmap/josm/tools/DontShowAgainInfo.java	(revision 745)
@@ -17,11 +17,19 @@
 
 	public static boolean show(String prefKey, String msg) {
-		return show(prefKey, new JLabel(msg));
+		return show(prefKey, new JLabel(msg), true);
+	}
+
+	public static boolean show(String prefKey, String msg, Boolean state) {
+		return show(prefKey, new JLabel(msg), state);
 	}
 
 	public static boolean show(String prefKey, Container msg) {
+		return show(prefKey, msg, true);
+	}
+
+	public static boolean show(String prefKey, Container msg, Boolean state) {
 		if (!Main.pref.getBoolean("message."+prefKey)) {
 			JCheckBox dontshowagain = new JCheckBox(tr("Do not show again"));
-			dontshowagain.setSelected(Main.pref.getBoolean("message."+prefKey, true));
+			dontshowagain.setSelected(Main.pref.getBoolean("message."+prefKey, state));
 			JPanel all = new JPanel(new GridBagLayout());
 			all.add(msg, GBC.eop());
