Index: orxonox/trunk/src/lib/graphics/importer/model.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/importer/model.cc	(revision 3914)
+++ orxonox/trunk/src/lib/graphics/importer/model.cc	(revision 3915)
@@ -48,5 +48,4 @@
   this->initGroup (this->currentGroup);
   this->scaleFactor = 1;
-  this->material = new Material();
 
   this->vertices = new Array();
@@ -83,9 +82,15 @@
     }
 
+  // deleting the MaterialList
   PRINTF(5)("Deleting Materials.\n");
-  if (this->material)
-    delete this->material;
-
-  // deleting the MaterialList
+
+  tIterator<Material>* tmpIt = this->materialList->getIterator();
+  Material* material = tmpIt->nextElement();
+  while(material)
+    {
+      delete material;
+      material = tmpIt->nextElement();
+    }
+  delete tmpIt;
   delete materialList;
 }
Index: orxonox/trunk/src/lib/graphics/importer/model.h
===================================================================
--- orxonox/trunk/src/lib/graphics/importer/model.h	(revision 3914)
+++ orxonox/trunk/src/lib/graphics/importer/model.h	(revision 3915)
@@ -94,10 +94,8 @@
   bool cleanupFaceElement(FaceElement* faceElem);
 
-
   tList<Material>* materialList;
 
  protected:
   float scaleFactor;    //!< The Factor with which the Model should be scaled. \todo maybe one wants to scale the Model after Initialisation
-  Material* material;   //!< Initial pointer to the Material. This can hold many materials, because Material can be added with Material::addMaterial(..)
 
   Material* findMaterialByName(const char* materialName);
Index: orxonox/trunk/src/lib/graphics/importer/objModel.cc
===================================================================
--- orxonox/trunk/src/lib/graphics/importer/objModel.cc	(revision 3914)
+++ orxonox/trunk/src/lib/graphics/importer/objModel.cc	(revision 3915)
@@ -25,4 +25,5 @@
 
 #include "debug.h"
+#include "compiler.h"
 
 /**
@@ -100,6 +101,5 @@
   
   this->setName(name);
-  if (this->material)
-    this->material->addTexturePath(this->objPath);
+
   this->objFileName = new char[strlen(name)+1];
   strcpy (this->objFileName, name);
@@ -208,5 +208,5 @@
 
   char buffer[PARSELINELENGTH];
-  Material* tmpMat = material;
+  Material* tmpMat = NULL;
 
   while(fgets(buffer, PARSELINELENGTH, stream))
@@ -226,5 +226,6 @@
       else if (!strncmp(buffer, "illum ", 6))
 	{
-	  tmpMat->setIllum(buffer+6);
+	  if (likely(tmpMat != NULL))
+	    tmpMat->setIllum(buffer+6);
 
 	}
@@ -232,46 +233,56 @@
       else if (!strncmp(buffer, "Kd ", 3))
 	{
-	  tmpMat->setDiffuse(buffer+3);
+	  if (likely(tmpMat != NULL))
+	    tmpMat->setDiffuse(buffer+3);
 	}
       // setting Ambient Color
       else if (!strncmp(buffer, "Ka ", 3))
 	{
-	  tmpMat->setAmbient(buffer+3);
+	  if (likely(tmpMat != NULL))
+	    tmpMat->setAmbient(buffer+3);
 	}
       // setting Specular Color
       else if (!strncmp(buffer, "Ks ", 3))
 	{
-	  tmpMat->setSpecular(buffer+3);
+	  if (likely(tmpMat != NULL))
+	    tmpMat->setSpecular(buffer+3);
 	}
       // setting The Specular Shininess
       else if (!strncmp(buffer, "Ns ", 3))
 	{
-	  tmpMat->setShininess(buffer+3);
+	  if (likely(tmpMat != NULL))
+	    tmpMat->setShininess(buffer+3);
 	}
       // setting up transparency
       else if (!strncmp(buffer, "d ", 2))
 	{
-	  tmpMat->setTransparency(buffer+2);
+	  if (likely(tmpMat != NULL))
+	    tmpMat->setTransparency(buffer+2);
 	}
       else if (!strncmp(buffer, "Tf ", 3))
 	{
-	  tmpMat->setTransparency(buffer+3);
+	  if (likely(tmpMat != NULL))
+	    tmpMat->setTransparency(buffer+3);
 	}
       
       else if (!strncmp(buffer, "map_Kd ", 7))
 	{
-	  tmpMat->setDiffuseMap(buffer+7);
+	  if (likely(tmpMat != NULL))
+	    tmpMat->setDiffuseMap(buffer+7);
 	}
       else if (!strncmp(buffer, "map_Ka ", 7))
 	{
-	  tmpMat->setAmbientMap(buffer+7);
+	  if (likely(tmpMat != NULL))
+	    tmpMat->setAmbientMap(buffer+7);
 	}
       else if (!strncmp(buffer, "map_Ks ", 7))
 	{
-	  tmpMat->setSpecularMap(buffer+7);
+	  if (likely(tmpMat != NULL))
+	    tmpMat->setSpecularMap(buffer+7);
 	}
       else if (!strncmp(buffer, "bump ", 5))
 	{
-	  tmpMat->setBump(buffer+7);
+	  if (likely(tmpMat != NULL))
+	    tmpMat->setBump(buffer+7);
 	}
      
