@@ -169,7 +169,7 @@ pub unsafe extern "C" fn dc_context_unref(context: *mut dc_context_t) {
169
169
eprintln ! ( "ignoring careless call to dc_context_unref()" ) ;
170
170
return ;
171
171
}
172
- Box :: from_raw ( context) ;
172
+ drop ( Box :: from_raw ( context) ) ;
173
173
}
174
174
175
175
#[ no_mangle]
@@ -463,7 +463,7 @@ pub unsafe extern "C" fn dc_event_unref(a: *mut dc_event_t) {
463
463
return ;
464
464
}
465
465
466
- Box :: from_raw ( a) ;
466
+ drop ( Box :: from_raw ( a) ) ;
467
467
}
468
468
469
469
#[ no_mangle]
@@ -687,7 +687,7 @@ pub unsafe extern "C" fn dc_event_emitter_unref(emitter: *mut dc_event_emitter_t
687
687
return ;
688
688
}
689
689
690
- Box :: from_raw ( emitter) ;
690
+ drop ( Box :: from_raw ( emitter) ) ;
691
691
}
692
692
693
693
#[ no_mangle]
@@ -2426,7 +2426,7 @@ pub unsafe extern "C" fn dc_array_unref(a: *mut dc_array::dc_array_t) {
2426
2426
return ;
2427
2427
}
2428
2428
2429
- Box :: from_raw ( a) ;
2429
+ drop ( Box :: from_raw ( a) ) ;
2430
2430
}
2431
2431
2432
2432
#[ no_mangle]
@@ -2607,7 +2607,7 @@ pub unsafe extern "C" fn dc_chatlist_unref(chatlist: *mut dc_chatlist_t) {
2607
2607
eprintln ! ( "ignoring careless call to dc_chatlist_unref()" ) ;
2608
2608
return ;
2609
2609
}
2610
- Box :: from_raw ( chatlist) ;
2610
+ drop ( Box :: from_raw ( chatlist) ) ;
2611
2611
}
2612
2612
2613
2613
#[ no_mangle]
@@ -2752,7 +2752,7 @@ pub unsafe extern "C" fn dc_chat_unref(chat: *mut dc_chat_t) {
2752
2752
return ;
2753
2753
}
2754
2754
2755
- Box :: from_raw ( chat) ;
2755
+ drop ( Box :: from_raw ( chat) ) ;
2756
2756
}
2757
2757
2758
2758
#[ no_mangle]
@@ -3022,7 +3022,7 @@ pub unsafe extern "C" fn dc_msg_unref(msg: *mut dc_msg_t) {
3022
3022
return ;
3023
3023
}
3024
3024
3025
- Box :: from_raw ( msg) ;
3025
+ drop ( Box :: from_raw ( msg) ) ;
3026
3026
}
3027
3027
3028
3028
#[ no_mangle]
@@ -3744,7 +3744,7 @@ pub unsafe extern "C" fn dc_contact_unref(contact: *mut dc_contact_t) {
3744
3744
eprintln ! ( "ignoring careless call to dc_contact_unref()" ) ;
3745
3745
return ;
3746
3746
}
3747
- Box :: from_raw ( contact) ;
3747
+ drop ( Box :: from_raw ( contact) ) ;
3748
3748
}
3749
3749
3750
3750
#[ no_mangle]
@@ -3908,7 +3908,7 @@ pub unsafe extern "C" fn dc_lot_unref(lot: *mut dc_lot_t) {
3908
3908
return ;
3909
3909
}
3910
3910
3911
- Box :: from_raw ( lot) ;
3911
+ drop ( Box :: from_raw ( lot) ) ;
3912
3912
}
3913
3913
3914
3914
#[ no_mangle]
@@ -4200,7 +4200,8 @@ pub unsafe extern "C" fn dc_accounts_get_account(
4200
4200
}
4201
4201
4202
4202
let accounts = & * accounts;
4203
- block_on ( async move { accounts. read ( ) . await . get_account ( id) . await } )
4203
+ block_on ( accounts. read ( ) )
4204
+ . get_account ( id)
4204
4205
. map ( |ctx| Box :: into_raw ( Box :: new ( ctx) ) )
4205
4206
. unwrap_or_else ( std:: ptr:: null_mut)
4206
4207
}
@@ -4215,7 +4216,8 @@ pub unsafe extern "C" fn dc_accounts_get_selected_account(
4215
4216
}
4216
4217
4217
4218
let accounts = & * accounts;
4218
- block_on ( async move { accounts. read ( ) . await . get_selected_account ( ) . await } )
4219
+ block_on ( accounts. read ( ) )
4220
+ . get_selected_account ( )
4219
4221
. map ( |ctx| Box :: into_raw ( Box :: new ( ctx) ) )
4220
4222
. unwrap_or_else ( std:: ptr:: null_mut)
4221
4223
}
@@ -4360,7 +4362,7 @@ pub unsafe extern "C" fn dc_accounts_get_all(accounts: *mut dc_accounts_t) -> *m
4360
4362
}
4361
4363
4362
4364
let accounts = & * accounts;
4363
- let list = block_on ( async move { accounts. read ( ) . await . get_all ( ) . await } ) ;
4365
+ let list = block_on ( accounts. read ( ) ) . get_all ( ) ;
4364
4366
let array: dc_array_t = list. into ( ) ;
4365
4367
4366
4368
Box :: into_raw ( Box :: new ( array) )
@@ -4430,7 +4432,7 @@ pub unsafe extern "C" fn dc_accounts_get_event_emitter(
4430
4432
}
4431
4433
4432
4434
let accounts = & * accounts;
4433
- let emitter = block_on ( async move { accounts. read ( ) . await . get_event_emitter ( ) . await } ) ;
4435
+ let emitter = block_on ( accounts. read ( ) ) . get_event_emitter ( ) ;
4434
4436
4435
4437
Box :: into_raw ( Box :: new ( emitter) )
4436
4438
}
0 commit comments