Index: /trunk/src/event/editor/frame/Editor.java
===================================================================
--- /trunk/src/event/editor/frame/Editor.java	(revision 173)
+++ /trunk/src/event/editor/frame/Editor.java	(revision 180)
@@ -549,13 +549,24 @@
 
         int index = eventTabsPane.getSelectedIndex();
-
+        //checks if there is a component at the tab selected, if so, then remove the associated event from the data model,
+        //and if it is removed, then remove the associated editor window.
         if (index >= 0 && eventTabsPane.getTabComponentAt(index) != null)
         {
             JPanel removable = (JPanel) eventTabsPane
                     .getSelectedComponent();
-            PropertyPanel update = this.model.properties.removeProperty(removable);
-
-            ((I_ScriptEventEditorPanel) update.getPanel()).removeAssociatedEvent();
-
+            PropertyPanel removedProperty = this.model.properties.getProperty(removable);
+            
+            if(((I_ScriptEventEditorPanel) removedProperty.getPanel()).removeAssociatedEvent())
+            {
+                this.model.properties.removeProperty(removable);
+            }
+
+        }
+        
+        //prevents an "empty editor" from appearing
+        if(eventTabsPane.getSelectedComponent() == null)
+        {
+            updateEventTime();
+            this.closeWindow();
         }
 
Index: /trunk/src/event/editor/frame/PropertyPanels.java
===================================================================
--- /trunk/src/event/editor/frame/PropertyPanels.java	(revision 119)
+++ /trunk/src/event/editor/frame/PropertyPanels.java	(revision 180)
@@ -198,4 +198,22 @@
         return removed;
     }
+    /**
+     * returns a corresponding PropertyPanel from a jPanel
+     * @param jPanel
+     * @return 
+     */
+    public PropertyPanel getProperty(JPanel jPanel)
+    {
+        PropertyPanel returnable = null;
+
+        for (PropertyPanel panel : properties)
+        {
+            if (panel.getPanel() == jPanel)
+            {
+                returnable = panel;
+            }
+        }
+        return returnable;
+    }
 
     public PropertyPanel removeProperty(String title)
Index: /trunk/src/event/editor/AudioPanel.java
===================================================================
--- /trunk/src/event/editor/AudioPanel.java	(revision 171)
+++ /trunk/src/event/editor/AudioPanel.java	(revision 180)
@@ -42,7 +42,8 @@
     public boolean removeAssociatedEvent()
     {
-        event.removeThis();
-        event = null;
-        return true;
+        //this makes it not possible to remove an AudioEvent from the script without deleting its respective I_AudioEvent.
+//        event.removeThis();
+//        event = null;
+        return false;
     }
 
