File tree Expand file tree Collapse file tree 4 files changed +8
-3
lines changed
Expand file tree Collapse file tree 4 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 22
33## Unreleased
44
5+ ### Bugfixes
6+
7+ - backend/rs: Prevent a potential deadlock during client cleanup
8+
59## 0.3.7 -- 2024-09-04
610
711### Bugfixes
Original file line number Diff line number Diff line change @@ -720,15 +720,15 @@ impl<D> ClientStore<D> {
720720 pub ( crate ) fn cleanup (
721721 & mut self ,
722722 pending_destructors : & mut Vec < PendingDestructor < D > > ,
723- ) -> SmallVec < [ ClientId ; 1 ] > {
723+ ) -> SmallVec < [ Client < D > ; 1 ] > {
724724 let mut cleaned = SmallVec :: new ( ) ;
725725 for place in & mut self . clients {
726726 if place. as_ref ( ) . map ( |client| client. killed ) . unwrap_or ( false ) {
727727 // Remove the client from the store and flush it one last time before dropping it
728728 let mut client = place. take ( ) . unwrap ( ) ;
729729 client. queue_all_destructors ( pending_destructors) ;
730730 let _ = client. flush ( ) ;
731- cleaned. push ( ClientId { id : client. id } ) ;
731+ cleaned. push ( client) ;
732732 }
733733 }
734734 cleaned
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ impl<D> State<D> {
5353 ObjectId { id : object_id } ,
5454 ) ;
5555 }
56+ std:: mem:: drop ( dead_clients) ;
5657 }
5758 }
5859
Original file line number Diff line number Diff line change @@ -127,7 +127,7 @@ impl<D> Registry<D> {
127127 Some ( ( target_global. interface , target_global. id . clone ( ) , target_global. handler . clone ( ) ) )
128128 }
129129
130- pub ( crate ) fn cleanup ( & mut self , dead_clients : & [ ClientId ] ) {
130+ pub ( crate ) fn cleanup ( & mut self , dead_clients : & [ Client < D > ] ) {
131131 self . known_registries
132132 . retain ( |obj_id| !dead_clients. iter ( ) . any ( |cid| cid. id == obj_id. client_id ) )
133133 }
You can’t perform that action at this time.
0 commit comments