Fix invalid atomic orderings

This commit is contained in:
Benjamin Saunders
2017-05-14 11:52:30 -07:00
parent 1ae9e1b014
commit bbd919e708

View File

@ -20,7 +20,7 @@ static INITIALIZED: AtomicBool = ATOMIC_BOOL_INIT;
/// # Panics /// # Panics
/// When the library has already been initialized /// When the library has already been initialized
pub fn init(ty: ApplicationType) -> Result<Context, InitError> { pub fn init(ty: ApplicationType) -> Result<Context, InitError> {
if INITIALIZED.swap(true, Ordering::AcqRel) { if INITIALIZED.swap(true, Ordering::Acquire) {
panic!("OpenVR has already been initialized!"); panic!("OpenVR has already been initialized!");
} }
@ -65,7 +65,7 @@ impl Context {
impl Drop for Context { impl Drop for Context {
fn drop(&mut self) { fn drop(&mut self) {
unsafe { sys::VR_ShutdownInternal() } unsafe { sys::VR_ShutdownInternal() }
INITIALIZED.store(false, Ordering::AcqRel); INITIALIZED.store(false, Ordering::Release);
} }
} }