Bug 6186

Benjamin Thaut code at benjamin-thaut.de
Wed Oct 2 11:26:22 PDT 2013


Am 02.10.2013 20:23, schrieb Maxim Fomin:
>
> For me the bug is invalid since out parameter is implicitly ref and it
> has nothing to do with initialization (you better think about it as an
> assignment). This means there are no reasons to call destructor.

In my eyes the bug is clearly not invalid because it caused memory leaks 
for me. If you have a struct which is a wrapper to a malloced buffer, 
and you pass it to a function which takes the struct as out parameter, 
the destructor will never be called because the memory will simply be 
reinitialized and the memory will leak. In my eyes this is a clear 
struct lifetime bug.


More information about the Digitalmars-d mailing list