mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer-rs.git
synced 2024-11-26 11:31:06 +00:00
Use downcast_unchecked() for sender in deep-notify signal handler
This is guaranteed to be of the correct type.
This commit is contained in:
parent
d7792a4fca
commit
520a9bb879
1 changed files with 8 additions and 3 deletions
|
@ -7,10 +7,10 @@
|
||||||
// except according to those terms.
|
// except according to those terms.
|
||||||
|
|
||||||
use glib;
|
use glib;
|
||||||
use glib::{Cast, IsA};
|
use glib::IsA;
|
||||||
use glib::translate::ToGlibPtr;
|
use glib::translate::ToGlibPtr;
|
||||||
use glib::signal::SignalHandlerId;
|
use glib::signal::SignalHandlerId;
|
||||||
use glib::object::ObjectExt;
|
use glib::object::{Downcast, ObjectExt};
|
||||||
|
|
||||||
use gobject_ffi;
|
use gobject_ffi;
|
||||||
|
|
||||||
|
@ -29,7 +29,12 @@ impl<O: IsA<::Object> + IsA<glib::Object> + glib::value::SetValue> GstObjectExtM
|
||||||
f: F,
|
f: F,
|
||||||
) -> SignalHandlerId {
|
) -> SignalHandlerId {
|
||||||
self.connect("deep-notify", false, move |values| {
|
self.connect("deep-notify", false, move |values| {
|
||||||
let obj: O = values[0].get::<glib::Object>().unwrap().downcast().unwrap();
|
let obj: O = unsafe {
|
||||||
|
values[0]
|
||||||
|
.get::<glib::Object>()
|
||||||
|
.unwrap()
|
||||||
|
.downcast_unchecked()
|
||||||
|
};
|
||||||
let prop_obj: ::Object = values[1].get().unwrap();
|
let prop_obj: ::Object = values[1].get().unwrap();
|
||||||
|
|
||||||
let prop_name = unsafe {
|
let prop_name = unsafe {
|
||||||
|
|
Loading…
Reference in a new issue