|
-
May 8th, 2010, 12:48 AM
#8
Re: Array of CString in VC++ 8?
The reason of the memory leak is simple. You call a constructor for your string
Code:
::new((void*)pTmp)CString; // call constructor
,but you never call a destructor (which, by the way, frees all memory, allocated in the CString constructor).
The statement
Code:
delete[] (BYTE*)pLabel ;
won't call any destructor for your objects.
Any way I think it's wrong. I can't even imagine a situation, when this code is useful.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|