> I just figured it would leak the vektor not crash..
a delete [] vektor; is missing.. I haven't heard that delete [] should do
a
cascading delete..?!?
Actually, it could crash because delete and delete[] are different
operators. If, for instance you define a specific operator new/delete which
allocates memory from a different heap than the one operator new[]/delete[]
uses, then you have UB. A crash is eligible as UB.
Besides, delete could free the same amount of memory as delete[] depending
on their implementation (and thus imply no resource leak), but you would not
call the destructors of the objects in the array, which is not a problem if
you have basic types. But my first remark is still valid, you never know if
delete and delete[] will be overriden or not.
--
JS