Skip to content

Commit

Permalink
Catch panics and C<->Rust boundary (#201)
Browse files Browse the repository at this point in the history
* Catch panics in callbacks and mark callbacks as invalid.
* Mark callbacks as invalid if they return Quit.
  • Loading branch information
wmedrano authored Sep 9, 2024
1 parent 7d9b94e commit c1e0281
Show file tree
Hide file tree
Showing 5 changed files with 274 additions and 70 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ license = "MIT"
name = "jack"
readme = "README.md"
repository = "https://github.com/RustAudio/rust-jack"
version = "0.12.0"
version = "0.12.1"

[dependencies]
bitflags = "1"
Expand Down
2 changes: 2 additions & 0 deletions src/client/async_client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ use jack_sys as j;
use std::fmt;
use std::fmt::Debug;
use std::mem;
use std::sync::atomic::AtomicBool;

use super::callbacks::clear_callbacks;
use super::callbacks::{CallbackContext, NotificationHandler, ProcessHandler};
Expand Down Expand Up @@ -58,6 +59,7 @@ where
client,
notification: notification_handler,
process: process_handler,
is_valid: AtomicBool::new(true),
});
CallbackContext::register_callbacks(&mut callback_context)?;
sleep_on_test();
Expand Down
Loading

0 comments on commit c1e0281

Please sign in to comment.