title: Freetype2 FT_Load_Char memory leaks
body: <p>I am hunting my programs memory leaks using <a href="https://vld.codeplex.com/" rel="nofollow">Visual leak detector</a> and cannot find how to get rid of FT_Load_Char leak, also documentation doesn't say anything about memory deallociation of GlyphSlot..</p>
  
  <p>Here is my code snipplet where w get the leak of about 350 bytes.</p>
  
  <pre><code>// creating ascii symbol map
  for (int i = 32; i &lt; 128; i++) {
      if (FT_Load_Char(face, i, FT_LOAD_RENDER)) { // leak comes from here
          fprintf(stderr, "Loading character %c failed!\n", i);
          continue;
      }
  
      glTexSubImage2D(GL_TEXTURE_2D, 0, ox, oy, g-&gt;bitmap.width, g-&gt;bitmap.rows, 
          GL_ALPHA, GL_UNSIGNED_BYTE, g-&gt;bitmap.buffer);
  
      float ax = g-&gt;advance.x &gt;&gt; 6;
      float ay = ay = g-&gt;advance.y &gt;&gt; 6;
  
      float bw = g-&gt;bitmap.width;
      float bh = g-&gt;bitmap.rows;
  
      float bl = g-&gt;bitmap_left;
      float bt = g-&gt;bitmap_top;
  
      m_GlyphMap[i] = Glyph(ax,ay, bw, bh, bl, bt, ox, oy);
  
      ox += g-&gt;bitmap.width + 1;
  
      // there should be some sort of deallociation...
  }
  </code></pre>
  
  <p><strong>So main question:</strong> is there is some function to deallocate GlyphSlot that I am missing? Or is it bug in Freetype?</p>