Unity Crashing / Memory Issue

I am loading an image from disk into a texture within an endless loop. When this happens the amount of RAM my application is using gradually starts to increase. After several hours an “Error” dialog box appears and then a Visual C++ Runtime Error box. When I open the Unity log file it states that a GLIB error has been encountered, and 128bytes could not be allocated. Any idea what’s happening? Here is the segment of code:

this.m_renScreen.materials[1].mainTexture = new Texture2D(300, 300, TextureFormat.DXT1, false);

while(this.m_bGetImage)
{
   var l_strPath : String = this.GetImagePath();		
   if(l_strPath == null)
   {
      yield WaitForSeconds(0.1);
      continue;
   } 
		
   var l_www : WWW = new WWW("file://" + l_strPath);
   yield l_www;
		
   l_www.LoadImageIntoTexture(this.m_renScreen.materials[1].mainTexture);
}

Thanks!

This looks like you found a memory leak. We have optimized the memory allocations of the WWW class in Unity 2.6 - so maybe that will fix the issue for you - but in any case, please submit a bug report with a project folder.

Thanks,
jonas