Fix access violation in the log module when called from a non-D thread.

This commit is contained in:
Sönke Ludwig 2017-09-21 14:09:19 +02:00
parent 59e3112e95
commit 9e0b5a7821

View file

@ -834,7 +834,7 @@ private struct LogOutputRange {
this.info.level = level;
this.info.thread = () @trusted { return Thread.getThis(); }(); // not @safe as of 2.065
this.info.threadID = makeid(this.info.thread);
this.info.threadName = () @trusted { return this.info.thread.name; } ();
this.info.threadName = () @trusted { return this.info.thread ? this.info.thread.name : ""; } ();
this.info.fiber = () @trusted { return Fiber.getThis(); }(); // not @safe as of 2.065
this.info.fiberID = makeid(this.info.fiber);
} catch (Exception e) {