We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 47ef9cd commit ce77933Copy full SHA for ce77933
rust/src/headless.rs
@@ -302,8 +302,11 @@ impl Session {
302
pub fn new() -> Result<Self, InitializationError> {
303
if license_location().is_some() {
304
// We were able to locate a license, continue with initialization.
305
+ // Grab the session before initialization to prevent another thread from initializing
306
+ // and shutting down before this thread can increment the SESSION_COUNT.
307
+ let session = Self::registered_session();
308
init()?;
- Ok(Self::registered_session())
309
+ Ok(session)
310
} else {
311
// There was no license that could be automatically retrieved, you must call [Self::new_with_license].
312
Err(InitializationError::NoLicenseFound)
0 commit comments