about summary refs log tree commit diff
path: root/src/libstd/sys/windows
diff options
context:
space:
mode:
authorAlex Crichton <alex@alexcrichton.com>2015-03-24 16:55:35 -0700
committerAlex Crichton <alex@alexcrichton.com>2015-03-24 18:37:16 -0700
commit3021d4c56422e15331e38f4b7b04c7229e024fda (patch)
treeb585f5625dde7ab0af35fb3dd41a67ba0507f525 /src/libstd/sys/windows
parentdb2c3ba0cfc7f9d4ee16be38f885ef129a3a8f71 (diff)
downloadrust-3021d4c56422e15331e38f4b7b04c7229e024fda.tar.gz
rust-3021d4c56422e15331e38f4b7b04c7229e024fda.zip
Test fixes and rebase conflicts, round 2
Diffstat (limited to 'src/libstd/sys/windows')
-rw-r--r--src/libstd/sys/windows/net.rs2
-rw-r--r--src/libstd/sys/windows/thread_local.rs8
2 files changed, 7 insertions, 3 deletions
diff --git a/src/libstd/sys/windows/net.rs b/src/libstd/sys/windows/net.rs
index e092faf4935..734268c70ac 100644
--- a/src/libstd/sys/windows/net.rs
+++ b/src/libstd/sys/windows/net.rs
@@ -36,7 +36,7 @@ pub fn init() {
                                 &mut data);
         assert_eq!(ret, 0);
 
-        rt::at_exit(|| { c::WSACleanup(); })
+        let _ = rt::at_exit(|| { c::WSACleanup(); });
     });
 }
 
diff --git a/src/libstd/sys/windows/thread_local.rs b/src/libstd/sys/windows/thread_local.rs
index 1359803070a..c908c791247 100644
--- a/src/libstd/sys/windows/thread_local.rs
+++ b/src/libstd/sys/windows/thread_local.rs
@@ -133,9 +133,8 @@ unsafe fn init_dtors() {
     if !DTORS.is_null() { return }
 
     let dtors = box Vec::<(Key, Dtor)>::new();
-    DTORS = boxed::into_raw(dtors);
 
-    rt::at_exit(move|| {
+    let res = rt::at_exit(move|| {
         DTOR_LOCK.lock();
         let dtors = DTORS;
         DTORS = 1 as *mut _;
@@ -143,6 +142,11 @@ unsafe fn init_dtors() {
         assert!(DTORS as uint == 1); // can't re-init after destructing
         DTOR_LOCK.unlock();
     });
+    if res.is_ok() {
+        DTORS = boxed::into_raw(dtors);
+    } else {
+        DTORS = 1 as *mut _;
+    }
 }
 
 unsafe fn register_dtor(key: Key, dtor: Dtor) {