Index: trunk/src/lib/lang/Makefile.am
===================================================================
--- trunk/src/lib/lang/Makefile.am	(revision 9671)
+++ trunk/src/lib/lang/Makefile.am	(revision 9672)
@@ -19,5 +19,5 @@
 
 
-check_PROGRAMS = test_object_list
+bin_PROGRAMS = test_object_list
 
 test_object_list_SOURCES = \
Index: trunk/src/lib/lang/new_class_id.cc
===================================================================
--- trunk/src/lib/lang/new_class_id.cc	(revision 9671)
+++ trunk/src/lib/lang/new_class_id.cc	(revision 9672)
@@ -26,5 +26,4 @@
  */
 NewClassID::NewClassID ()
-    : _objectList(NULL)
 {}
 
@@ -35,6 +34,9 @@
 NewClassID::~NewClassID ()
 {
-  assert(_objectList != NULL);
-  _objectList->unregisterObject(this->_iterators);
+  //  assert(_objectList != NULL);
+  std::list<NewObjectListBase::ClassEntry>::iterator it;
+  for (it = this->_classes.begin(); it != this->_classes.end(); ++it)
+    (*it)._objectList->unregisterObject((*it)._iterator);
+  //_objectList->unregisterObject(this->_iterators);
 }
 
Index: trunk/src/lib/lang/new_class_id.h
===================================================================
--- trunk/src/lib/lang/new_class_id.h	(revision 9671)
+++ trunk/src/lib/lang/new_class_id.h	(revision 9672)
@@ -26,6 +26,5 @@
 
 private:
-  NewObjectListBase*                           _objectList;
-  std::list<NewObjectListBase::IteratorBase*>  _iterators; //!< Iterators to the class-list's positions.
+  std::list<NewObjectListBase::ClassEntry>       _classes;
 };
 
@@ -34,6 +33,8 @@
     inline void NewClassID::registerObject(T* object, NewObjectList<T>& objectList)
 {
-  this->_objectList = &objectList;
-  _iterators.push_back(objectList.registerObject(object, this->_objectList));
+  this->_classes.push_back(NewObjectListBase::ClassEntry(&objectList, objectList.registerObject(object)));
+
+  /*  this->_objectList = &objectList;
+  _iterators.push_back(objectList.registerObject(object, this->_objectList));*/
 }
 
Index: trunk/src/lib/lang/new_object_list.h
===================================================================
--- trunk/src/lib/lang/new_object_list.h	(revision 9671)
+++ trunk/src/lib/lang/new_object_list.h	(revision 9672)
@@ -25,4 +25,9 @@
 public:
   class IteratorBase { };
+  struct ClassEntry{
+    inline ClassEntry (NewObjectListBase* objectList, NewObjectListBase::IteratorBase* iterator) : _objectList(objectList), _iterator(iterator) {}
+    NewObjectListBase*                _objectList;
+    NewObjectListBase::IteratorBase*  _iterator;
+  };
 
 public:
@@ -45,5 +50,5 @@
   static const std::list<std::string>&  getClassNames();
 
-  virtual void unregisterObject(std::list<NewObjectListBase::IteratorBase*> _iterators) = 0;
+  virtual void unregisterObject(IteratorBase* _iterators) = 0;
 
 protected:
@@ -91,6 +96,7 @@
   {
   public:
-    Iterator(iterator it) { it = it; }
-    typename NewObjectList::iterator it;
+    Iterator(iterator it) { _it = it; }
+    inline iterator& it() { return _it; }
+    typename NewObjectList::iterator _it;
   };
 
@@ -102,7 +108,6 @@
   inline const list&      objects() const { return _objects; };
 
-  NewObjectListBase::IteratorBase* registerObject(T* object, NewObjectListBase* objectList);
-  void unregisterObject(const IteratorBase& iterator);
-  virtual void unregisterObject(std::list<NewObjectListBase::IteratorBase*> _iterators) = 0;
+  NewObjectListBase::IteratorBase* registerObject(T* object);
+  void unregisterObject(IteratorBase* iterator);
 
   virtual void debug() const;
@@ -145,11 +150,6 @@
 
 template <class T>
-    NewObjectListBase::IteratorBase* NewObjectList<T>::registerObject(T* object, NewObjectListBase* objectList)
+    NewObjectListBase::IteratorBase* NewObjectList<T>::registerObject(T* object)
 {
-  if(this->_typeOfList.empty())
-  {
-    this->_typeOfList.push_back(objectList);
-  }
-
   this->_objects.push_front(object);
   return new Iterator(this->_objects.begin());
@@ -157,7 +157,7 @@
 
 template <class T>
-void NewObjectList<T>::unregisterObject(const IteratorBase& iterator)
+void NewObjectList<T>::unregisterObject(IteratorBase* iterator)
 {
-  this->_objects.erase(static_cast<Iterator>(iterator));
+  this->_objects.erase(static_cast<Iterator*>(iterator)->it());
   //_objects.erase(std::find(_objects.begin(), _objects.end(), object));
 }
Index: trunk/src/lib/lang/test_object_list.cc
===================================================================
--- trunk/src/lib/lang/test_object_list.cc	(revision 9671)
+++ trunk/src/lib/lang/test_object_list.cc	(revision 9672)
@@ -10,5 +10,9 @@
   bool operator==(const std::string& name) const { return _objectName == name; };
 
+  NewObjectListDeclaration(BaseObject);
+
+
 protected:
+  BaseObject(const std::string& objectName = "") : _objectName(objectName) { this->registerObject(this, objectList); };
   template<class T>
       inline void registerObject(T* object, NewObjectList<T>& objectList) { _id.registerObject(object, objectList); };
@@ -17,5 +21,8 @@
   std::string   _objectName;
 
+
 };
+NewObjectListDefinition(BaseObject);
+
 
 class Test : public BaseObject
@@ -53,17 +60,18 @@
 {
   Test* test = new Test();
-  test->setName("Testing");
+  test->setName("Test-object");
 
   Test::objectList.debug();
 
-  delete test;
 
   Test::objectList.debug();
   Bone* bone = new Bone();
+  bone->setName("Bone-object");
+
+  std::cout << "Here is debug of all Classes\n";
+  BaseObject::objectList.debug();
   delete bone;
+  delete test;
 
-
-
-  std::cout << NewObjectListBase::classCount() << std::endl;
 }
 
