Skip to content

Commit c1e0281

Browse files
authored
Catch panics and C<->Rust boundary (#201)
* Catch panics in callbacks and mark callbacks as invalid. * Mark callbacks as invalid if they return Quit.
1 parent 7d9b94e commit c1e0281

File tree

5 files changed

+274
-70
lines changed

5 files changed

+274
-70
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ license = "MIT"
88
name = "jack"
99
readme = "README.md"
1010
repository = "https://github.com/RustAudio/rust-jack"
11-
version = "0.12.0"
11+
version = "0.12.1"
1212

1313
[dependencies]
1414
bitflags = "1"

src/client/async_client.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ use jack_sys as j;
22
use std::fmt;
33
use std::fmt::Debug;
44
use std::mem;
5+
use std::sync::atomic::AtomicBool;
56

67
use super::callbacks::clear_callbacks;
78
use super::callbacks::{CallbackContext, NotificationHandler, ProcessHandler};
@@ -58,6 +59,7 @@ where
5859
client,
5960
notification: notification_handler,
6061
process: process_handler,
62+
is_valid: AtomicBool::new(true),
6163
});
6264
CallbackContext::register_callbacks(&mut callback_context)?;
6365
sleep_on_test();

0 commit comments

Comments
 (0)