Skip to content

Commit

Permalink
Fix issue 17440: do not call .destroy on class instances in .nullify.
Browse files Browse the repository at this point in the history
  • Loading branch information
H. S. Teoh committed Jan 17, 2018
1 parent 7471b2a commit 5b04f45
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion std/typecons.d
Original file line number Diff line number Diff line change
Expand Up @@ -2508,7 +2508,10 @@ Forces $(D this) to the null state.
*/
void nullify()()
{
.destroy(_value);
static if (is(T == class))
_value = null;
else
.destroy(_value);
_isNull = true;
}

Expand Down

0 comments on commit 5b04f45

Please sign in to comment.