mirror of
https://github.com/mii443/rust-openvr.git
synced 2025-08-22 16:25:36 +00:00
Fix invalid atomic orderings
This commit is contained in:
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user