File tree Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Expand file tree Collapse file tree 3 files changed +5
-3
lines changed Original file line number Diff line number Diff line change 11[package ]
22name = " compio-runtime"
3- version = " 0.6.0 "
3+ version = " 0.6.1 "
44description = " High-level runtime for compio"
55categories = [" asynchronous" ]
66keywords = [" async" , " runtime" ]
Original file line number Diff line number Diff line change @@ -38,7 +38,8 @@ impl<T: OpCode> Future for OpFlagsFuture<T> {
3838impl < T : OpCode > Drop for OpFlagsFuture < T > {
3939 fn drop ( & mut self ) {
4040 if let Some ( key) = self . key . take ( ) {
41- Runtime :: with_current ( |r| r. cancel_op ( key) )
41+ // If there's no runtime, it's OK to forget it.
42+ Runtime :: try_with_current ( |r| r. cancel_op ( key) ) . ok ( ) ;
4243 }
4344 }
4445}
Original file line number Diff line number Diff line change @@ -144,7 +144,8 @@ impl Future for TimerFuture {
144144
145145impl Drop for TimerFuture {
146146 fn drop ( & mut self ) {
147- Runtime :: with_current ( |r| r. cancel_timer ( self . key ) ) ;
147+ // If there's no runtime, it's OK to forget it.
148+ Runtime :: try_with_current ( |r| r. cancel_timer ( self . key ) ) . ok ( ) ;
148149 }
149150}
150151
You can’t perform that action at this time.
0 commit comments