Index: code/branches/notifications/src/modules/notifications/NotificationManager.cc
===================================================================
--- code/branches/notifications/src/modules/notifications/NotificationManager.cc	(revision 7395)
+++ code/branches/notifications/src/modules/notifications/NotificationManager.cc	(revision 7398)
@@ -165,5 +165,5 @@
             this->listenerCounter_[notification] = this->listenerCounter_[notification] - 1;
 
-        COUT(4) << "Notification (&" << notification << ")unregistered with the NotificationManager from listener (&" << listener << ")" << std::endl;
+        COUT(4) << "Notification (&" << notification << ") unregistered with the NotificationManager from listener (&" << listener << ")" << std::endl;
     }
 
@@ -212,5 +212,5 @@
         // If all senders are the target of the listener, then the list of notification for that specific listener is te same as the list of all Notifications.
         bool bAll = set.find(NotificationManager::ALL) != set.end();
-        std::multimap<std::time_t, Notification*> map;
+        std::multimap<std::time_t, Notification*>* map;
         if(bAll)
             this->notificationLists_[index] = &this->allNotificationsList_;
@@ -218,5 +218,5 @@
         {
             this->notificationLists_[index] = new std::multimap<std::time_t, Notification*>;
-            map = *this->notificationLists_[index];
+            map = this->notificationLists_[index];
         }
 
@@ -227,5 +227,5 @@
             {
                 if(!bAll)
-                    map.insert(std::pair<std::time_t, Notification*>(it->first, it->second));
+                    map->insert(std::pair<std::time_t, Notification*>(it->first, it->second));
                 std::map<Notification*, unsigned int>::iterator counterIt = this->listenerCounter_.find(it->second);
                 if(counterIt == this->listenerCounter_.end())
@@ -254,18 +254,18 @@
         std::multimap<std::time_t, Notification*>* map = this->notificationLists_.find(identifier)->second;
 
-        // Make sure all Notifications are removed.
+        // If the map is not the map of all notifications, make sure all Notifications are removed and delete it.
         std::multimap<std::time_t, Notification*>::iterator it = map->begin();
-        while(it != map->end())
-        {
-            this->unregisterNotification(it->second, listener);
-            it = map->begin();
+        if(map != &this->allNotificationsList_)
+        {
+            while(it != map->end())
+            {
+                this->unregisterNotification(it->second, listener);
+                it = map->begin();
+            }
+            delete map;
         }
 
         this->listenerList_.erase(listener);
         this->notificationLists_.erase(identifier);
-
-        // If the map is not the map of all notifications, delete it.
-        if(map != &this->allNotificationsList_)
-            delete map;
 
         COUT(4) << "NotificationListener unregistered with the NotificationManager." << std::endl;
Index: code/branches/notifications/src/modules/notifications/NotificationQueue.cc
===================================================================
--- code/branches/notifications/src/modules/notifications/NotificationQueue.cc	(revision 7395)
+++ code/branches/notifications/src/modules/notifications/NotificationQueue.cc	(revision 7398)
@@ -100,4 +100,6 @@
             NotificationManager::getInstance().unregisterListener(this);
             NotificationManager::getInstance().unregisterQueue(this);
+
+            GUIManager::getInstance().getLuaState()->doString("NotificationLayer.removeQueue(\"" + this->getName() +  "\")");
         }
     }
@@ -360,4 +362,5 @@
         this->targets_.clear();
 
+        //TODO: Do with SubString.
         std::string* pTemp;
         unsigned int index = 0;
Index: code/branches/notifications/src/modules/notifications/NotificationQueue.h
===================================================================
--- code/branches/notifications/src/modules/notifications/NotificationQueue.h	(revision 7395)
+++ code/branches/notifications/src/modules/notifications/NotificationQueue.h	(revision 7398)
@@ -75,4 +75,6 @@
             NotificationQueue(const std::string& name, const std::string& senders = NotificationManager::ALL, unsigned int size = NotificationQueue::DEFAULT_SIZE, unsigned int displayTime = NotificationQueue::DEFAULT_DISPLAY_TIME);
             virtual ~NotificationQueue();
+
+            void destroy(void) { this->OrxonoxClass::destroy(); } // tolua_export
 
             virtual void tick(float dt); //!< To update from time to time.
