Skip to content

Commit

Permalink
Fix opencascade crashes
Browse files Browse the repository at this point in the history
  • Loading branch information
DSchroer committed Mar 9, 2023
1 parent cd3414c commit 294fadd
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Use Create, Modify and Remove events for file watcher
- Order of operations
- Windows builds crashing randomly
- Crash on opencascade operations with invalid arguments

## [v0.0.1] - 2023-02-10

Expand Down
8 changes: 6 additions & 2 deletions crates/opencascade/src/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,11 @@ pub trait Builder<T>: Command {
pin.pin_mut().build(&progress);
}

// SAFETY: safe since is_done and build were checked
Ok(unsafe { pin.pin_mut().value() })
if !pin.is_done() {
Err("opencascade operation failed".into())
} else {
// SAFETY: safe since is_done and build were checked
Ok(unsafe { pin.pin_mut().value() })
}
}
}

0 comments on commit 294fadd

Please sign in to comment.