@@ -25,7 +25,9 @@ pub trait BaseButtonExt {
25
25
/// and call the correct implementation of the function.
26
26
impl < O : IsA < BaseButton > > BaseButtonExt for O {
27
27
fn sync_method ( & self , extra_text : Box < Option < String > > ) {
28
- unsafe { imp:: base_button_sync_method ( self . as_ref ( ) . to_glib_none ( ) . 0 , extra_text) }
28
+ unsafe {
29
+ imp:: base_button_sync_method ( self . as_ref ( ) . to_glib_none ( ) . 0 , Box :: into_raw ( extra_text) )
30
+ }
29
31
}
30
32
31
33
fn async_method ( & self ) -> PinnedFuture {
@@ -49,7 +51,7 @@ pub trait BaseButtonImpl: ButtonImpl + ObjectImpl + 'static {
49
51
let data = Self :: type_data ( ) ;
50
52
let parent_class = data. as_ref ( ) . parent_class ( ) as * mut imp:: BaseButtonClass ;
51
53
if let Some ( ref f) = ( * parent_class) . sync_method {
52
- f ( obj. to_glib_none ( ) . 0 , extra_text)
54
+ f ( obj. to_glib_none ( ) . 0 , Box :: into_raw ( extra_text) )
53
55
} else {
54
56
unimplemented ! ( )
55
57
}
@@ -87,13 +89,13 @@ unsafe impl<T: BaseButtonImpl> IsSubclassable<T> for BaseButton {
87
89
// Virtual method default implementation trampolines
88
90
unsafe extern "C" fn sync_method_trampoline < T : ObjectSubclass > (
89
91
this : * mut imp:: BaseButtonInstance ,
90
- extra_text : Box < Option < String > > ,
92
+ extra_text : * mut Option < String > ,
91
93
) where
92
94
T : BaseButtonImpl ,
93
95
{
94
96
let instance = & * ( this as * const T :: Instance ) ;
95
97
let imp = instance. impl_ ( ) ;
96
- imp. sync_method ( & from_glib_borrow ( this) , extra_text)
98
+ imp. sync_method ( & from_glib_borrow ( this) , Box :: from_raw ( extra_text) )
97
99
}
98
100
99
101
unsafe extern "C" fn async_method_trampoline < T : ObjectSubclass > (
0 commit comments