From bbd919e70836590a246872fa8d50bac05cf607c5 Mon Sep 17 00:00:00 2001 From: Benjamin Saunders Date: Sun, 14 May 2017 11:52:30 -0700 Subject: [PATCH] Fix invalid atomic orderings --- src/lib.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index c65fad9..d2ef572 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -20,7 +20,7 @@ static INITIALIZED: AtomicBool = ATOMIC_BOOL_INIT; /// # Panics /// When the library has already been initialized pub fn init(ty: ApplicationType) -> Result { - if INITIALIZED.swap(true, Ordering::AcqRel) { + if INITIALIZED.swap(true, Ordering::Acquire) { panic!("OpenVR has already been initialized!"); } @@ -65,7 +65,7 @@ impl Context { impl Drop for Context { fn drop(&mut self) { unsafe { sys::VR_ShutdownInternal() } - INITIALIZED.store(false, Ordering::AcqRel); + INITIALIZED.store(false, Ordering::Release); } }