--- Comment #6 from Steven Schveighoffer <schvei...@yahoo.com> 2010-04-05
04:43:18 PDT ---
(In reply to comment #5)
> But the allocator is *not* called automatically, strictly speaking. 'new' is
> your call to the allocator. Since you use malloc() instead of the garbage
> collector, 'delete' then becomes necessary.
> Under normal circumstances, an exception thrown during construction wouldn't
> leak memory because the garbage collector would eventually collect it; in your
> code, you took on the task of manually allocating and deallocating memory for
> objects of class C. It makes sense to me that such custom allocation would
> entail finer management of exceptional situations.
Not that I disagree this bug is obsolete, but what would you call delete on?
With the failed construction, you never got a pointer to the class data.
If class allocators were to be saved, I think the correct behavior on a failed
constructor should be to call the deallocator.
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------