title: Is deleting an array stored as static local variable needed, and how?
body: <p>I have a few arrays and a resource that needs deletion, the value of these variables are retained throughout the lifetime of the program and they are only used in a single function so it naturally fits into static variables:</p>
  
  <pre><code>void func() {
      static GLfloat arrs[4] = {1, 1, 1, 1};
      static GLUquadric* quad = gluNewQuadric(); // delete with gluDeleteQuadric(quad)
      //... other codes ... 
  }
  </code></pre>
  
  <p>However, if I used static, I would have trouble with delete-ing these resources since I cannot access these variables from outside the function. I can make these globals, but I would like to avoid that if possible.</p>
  
  <p>So the question is:</p>
  
  <ol>
  <li>Is arrs[] stack- or heap-allocated? And so, would I need to delete it?</li>
  <li>In the case of GLUquadric, obviously the compiler would not know how to properly delete it, for now I've used a <a href="http://en.wikipedia.org/wiki/Resource_Acquisition_Is_Initialization" rel="nofollow noreferrer">RAII</a> wrapper class which worked beautifully, but I'm looking if there's an even simpler approach.</li>
  </ol>
  
  <p>valgrind complained for not releasing the GLUquadric, and I guess I'd just clean it up rather than silencing valgrind even though the program should be about to end anyway when I will release them and these resources are probably(?) released when the program ends.</p>