builder: Remove Send + Sync in connect_signals_full callback
@@ -22,7 +22,7 @@ impl Builder {
pub trait BuilderExtManual: 'static {
fn get_object<T: IsA<Object>>(&self, name: &str) -> Option<T>;
fn add_from_file<T: AsRef<Path>>(&self, file_path: T) -> Result<(), Error>;
- fn connect_signals_full<P: FnMut(&Builder, &str) -> Box<dyn Fn(&[glib::Value]) -> Option<glib::Value> + Send + Sync + 'static>>(&self, func: P);
+ fn connect_signals_full<P: FnMut(&Builder, &str) -> Box<dyn Fn(&[glib::Value]) -> Option<glib::Value> + 'static>>(&self, func: P);
}
impl<O: IsA<Builder>> BuilderExtManual for O {
@@ -44,9 +44,9 @@ impl<O: IsA<Builder>> BuilderExtManual for O {
}
}
- fn connect_signals_full<P: FnMut(&Builder, &str) -> Box<dyn Fn(&[glib::Value]) -> Option<glib::Value> + Send + Sync + 'static>>(&self, func: P) {
+ fn connect_signals_full<P: FnMut(&Builder, &str) -> Box<dyn Fn(&[glib::Value]) -> Option<glib::Value> + 'static>>(&self, func: P) {
let func_data: P = func;
- unsafe extern "C" fn func_func<P: FnMut(&Builder, &str) -> Box<dyn Fn(&[glib::Value]) -> Option<glib::Value> + Send + Sync + 'static>>(builder: *mut gtk_sys::GtkBuilder, object: *mut gobject_sys::GObject, signal_name: *const libc::c_char, handler_name: *const libc::c_char, connect_object: *mut gobject_sys::GObject, flags: gobject_sys::GConnectFlags, user_data: glib_sys::gpointer) {
+ unsafe extern "C" fn func_func<P: FnMut(&Builder, &str) -> Box<dyn Fn(&[glib::Value]) -> Option<glib::Value> + 'static>>(builder: *mut gtk_sys::GtkBuilder, object: *mut gobject_sys::GObject, signal_name: *const libc::c_char, handler_name: *const libc::c_char, connect_object: *mut gobject_sys::GObject, flags: gobject_sys::GConnectFlags, user_data: glib_sys::gpointer) {
assert!(connect_object.is_null(), "Connect object is not supported");
assert!(flags & gobject_sys::G_CONNECT_SWAPPED == 0, "Swapped signal handler is not supported");
@@ -57,7 +57,7 @@ impl<O: IsA<Builder>> BuilderExtManual for O {
let callback: *mut P = user_data as *const _ as usize as *mut P;
let func = (*callback)(&builder, handler_name.as_str());
object
- .connect(signal_name.as_str(), flags & gobject_sys::G_CONNECT_AFTER != 0, move |args| func(args))
+ .connect_unsafe(signal_name.as_str(), flags & gobject_sys::G_CONNECT_AFTER != 0, move |args| func(args))
.expect("Failed to connect to builder signal");
}
let func = Some(func_func::<P> as _);
