How to delete an array of pointers to generic type objects
<p>My class has a generic array of pointers member named <code>A</code>:</p>

<pre><code>T** A
</code></pre>

<p>Currently, i delete the array in the destructor in the following way:</p>

<pre><code>~MyQuickInitArray(){
    delete [] A;
};
</code></pre>

<p>Will this cause a memory leak? if so, should i iterate through the array and call <code>delete</code> on each object?</p>

<p>On a side note -  Do I need to call <code>delete [] B</code> if <code>B</code> is an array of integers or does the destructor handles it already? </p>

<p><strong>EDIT:</strong></p>

<p>This is how the allocation occurs:</p>

<pre><code>MyQuickInitArray(int size)
{
    if(size &lt;= 0)
    {
        throw new std::exception;
    }

    _size = size;
    _counter = 0;
    A = new T*[size];
    B = new int[size];
    C = new int[size];
}
    MyQuickInitArray(const MyQuickInitArray&amp; myQuickInitArray)
    {
        _size = myQuickInitArray._size;
        _counter = myQuickInitArray._counter;
        A = new T*[_size];

        for(int i = 0; i&lt;_size ;i++)
        {
            if(myQuickInitArray.A[i] != NULL)
            {
                A[i] = new T(*myQuickInitArray.A[i]);
            }
        }

        B = myQuickInitArray.B;
        C = myQuickInitArray.C;
    }
</code></pre>
