From 708ec67070411c5d752c73f63937375eff32547c Mon Sep 17 00:00:00 2001 From: Mike Bierlee Date: Sun, 18 Dec 2016 01:16:00 +0100 Subject: [PATCH] Prevent memory corruption in DMD 2.066.1 As a consequence registations will NOT be cleared during deconstruction of the container in that version --- source/poodinis/container.d | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/source/poodinis/container.d b/source/poodinis/container.d index 3b85e9c..50a6b43 100644 --- a/source/poodinis/container.d +++ b/source/poodinis/container.d @@ -24,6 +24,7 @@ import std.string; import std.algorithm; import std.concurrency; import std.traits; +import std.compiler; debug { import std.stdio; @@ -119,7 +120,10 @@ synchronized class DependencyContainer { private ResolveOption persistentResolveOptions; ~this() { - clearAllRegistrations(); + pragma(msg, __VERSION__); + if (!(vendor == Vendor.digitalMars && __VERSION__ == 2066)) { + clearAllRegistrations(); + } } /**