From cbd77cd71b74fb8cf15a54ccf870dc19d17eea80 Mon Sep 17 00:00:00 2001
From: Alessandro Ranellucci <aar@cpan.org>
Date: Mon, 21 May 2012 18:44:31 +0200
Subject: [PATCH] Compatibility with recent Moo changes for threads global
 destruction. #379

---
 lib/Slic3r.pm | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/lib/Slic3r.pm b/lib/Slic3r.pm
index 17c204b51..792cad87a 100644
--- a/lib/Slic3r.pm
+++ b/lib/Slic3r.pm
@@ -15,8 +15,10 @@ sub debugf {
 }
 
 # load threads before Moo as required by it
-use Config;
-our $have_threads = $Config{useithreads} && eval "use threads; use Thread::Queue; 1";
+BEGIN {
+    use Config;
+    our $have_threads = $Config{useithreads} && eval "use threads; use Thread::Queue; 1";
+}
 
 use Moo;
 use Slic3r::Config;