title: Should HANDLE returned by CreateEvent be disposed?
body: <p>I was inspecting someone's code and I saw this:</p>
  
  <pre><code>template&lt;typename Data&gt;
  class ConcurrentQueue {
  
      private:
          HANDLE dataPushEvent;
          // More Private Members...
  
      public:
          ConcurrentQueue() {
              dataPushEvent = CreateEvent(NULL, TRUE, FALSE, NULL);
          }
  
      // Public Methods...
  
  };
  </code></pre>
  
  <p>As you can see, there is no destructor on this class, and the <code>dataPushEvent</code> is not explicitly freed anywhere in this class. Since it's a private member, it cannot be accesed externally, so I was thinking this'd probably create a memory leak.</p>
  
  <p>Unless this handle is not supposed to be disposed.</p>
  
  <p>I'm new to C++ and Windows programming. As far as I'm concerned, <code>HANDLE</code> is a <code>void *</code>, and as all pointers, its reference should be released when we are done using it.</p>
  
  <p>Am I right?</p>