Compiler bug? (alias sth this; and std.signals)
eskimo
jfanatiker at gmx.at
Tue Nov 13 14:56:13 PST 2012
Not a compiler bug. A bug in the implementation of std.signals.
> > writeln(f.prop);
Property is a struct and thus it is passed by value, which means that
the signal is copied. Signal does not define a postblit constructor,
because it was intended to be used in classes, so a bitwise copy is
done. Meaning that the internal allocated storage is freed twice.
If used in a class there is no issue with copying a signal, because it
is a mixin and does not exist on its own and an object has reference
semantics.
I am already working on a replacement for std.signals which fixes some
of its shortcomings. It will also fix this one.
Best regards,
Robert
More information about the Digitalmars-d
mailing list