Prevent memory corruption in DMD 2.066.1

As a consequence registations will NOT be cleared during deconstruction of the container in that version
This commit is contained in:
Mike Bierlee 2016-12-18 01:16:00 +01:00
parent 3d9a449766
commit 708ec67070

View file

@ -24,6 +24,7 @@ import std.string;
import std.algorithm;
import std.concurrency;
import std.traits;
import std.compiler;
debug {
import std.stdio;
@ -119,8 +120,11 @@ synchronized class DependencyContainer {
private ResolveOption persistentResolveOptions;
~this() {
pragma(msg, __VERSION__);
if (!(vendor == Vendor.digitalMars && __VERSION__ == 2066)) {
clearAllRegistrations();
}
}
/**
* Register a dependency by concrete class type.