luaur-common 0.1.3

Foundational data structures and flags for the luaur Luau-in-Rust toolchain.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
//! Source: `Common/src/TimeTrace.cpp:94-98` (hand-ported)
//! C++ `~GlobalContext() { if (traceFile) fclose(traceFile); }`.
use crate::records::global_context::GlobalContext;

impl Drop for GlobalContext {
    fn drop(&mut self) {
        // Closing the file: dropping the `Option<File>` flushes and closes it,
        // matching `fclose(traceFile)`.
        if let Ok(mut state) = self.state.lock() {
            state.trace_file = None;
        }
    }
}