title: Access Violation on glDelete*
body: <p>I got a strange problem here: i have a potential large (as in up to 500mb) 3d texture which is created several times per second. The size of the texture might change so reusing the old texture is not an option every time. The logical step to avoid memory consumption is to delete the texture every time it is not used anymore (using glDeleteTexture) but the program crashes with a read or write access violation pretty soon. The same thing happens on glDeleteBuffer when called on the buffer i use to update the texture.</p>
  
  <p>In my eyes this can't happen as the glDelete* functions are pretty failsafe. If you give them a gl handle which is not a corresponding object they just don't do anything.</p>
  
  <p>The interesting thing is that if i just don't delete the textures and buffers the program runs fine until it eventually runs out of memory on the graphics card.</p>
  
  <p>This is running on Windows XP 32bit, NVIDIA Geforce 9500GT with 266.58er drivers, programming language is c++ in visual studio 2005.</p>
  
  <h2>Update</h2>
  
  <p>Apparently glDelete is not the only function affected. I just got violations in several other methods (which wasn't the case yesterday) ... looks like something is damn broken here. </p>
  
  <h2>Update 2</h2>
  
  <p>this shouldn't fail should it?</p>
  
  <pre><code>template &lt;&gt; inline
  Texture&lt;GL_TEXTURE_3D&gt;::Texture(
      GLint internalFormat,
      glm::ivec3 size,
      GLint border ) : Wrapper&lt;detail::gl_texture&gt;()
  {
      glGenTextures(1,&amp;object.t);
  
      std::vector&lt;GLbyte&gt; tmp(glm::compMul(size)*4);
      glTextureImage3DEXT(
          object,             // texture
          GL_TEXTURE_3D,          // target
          0,                      // level
          internalFormat,         // internal format
          size.x, size.y, size.z, // size
          border,                 // border
          GL_RGBA,                // format
          GL_BYTE,                // type
          &amp;tmp[0]);               // don't load anything
  }
  </code></pre>
  
  <p>fails with:</p>
  
  <pre><code>Exception (first chance) at 0x072c35c0: 0xC0000005:  Access violoation while writing to position 0x00000004.
  Unhandled exception at 0x072c35c0 in Project.exe: 0xC0000005: Access violatione while writing to position 0x00000004.
  </code></pre>
  
  <p>best guess: something messing up the program memory?</p>