mirror of
https://github.com/ntex-rs/ntex.git
synced 2025-04-05 13:57:39 +03:00
Fix borrow error when timer get dropped immidietly after start
This commit is contained in:
parent
aca40ad6ff
commit
8b3a1bc474
3 changed files with 12 additions and 4 deletions
|
@ -1,5 +1,9 @@
|
||||||
# Changes
|
# Changes
|
||||||
|
|
||||||
|
## [0.1.5] - 2021-12-27
|
||||||
|
|
||||||
|
* Fix borrow error when timer get dropped immidietly after start
|
||||||
|
|
||||||
## [0.1.4] - 2021-12-21
|
## [0.1.4] - 2021-12-21
|
||||||
|
|
||||||
* mpsc: add Receiver::poll_recv() method
|
* mpsc: add Receiver::poll_recv() method
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "ntex-util"
|
name = "ntex-util"
|
||||||
version = "0.1.4"
|
version = "0.1.5"
|
||||||
authors = ["ntex contributors <team@ntex.rs>"]
|
authors = ["ntex contributors <team@ntex.rs>"]
|
||||||
description = "Utilities for ntex framework"
|
description = "Utilities for ntex framework"
|
||||||
keywords = ["network", "framework", "async", "futures"]
|
keywords = ["network", "framework", "async", "futures"]
|
||||||
|
@ -16,7 +16,7 @@ name = "ntex_util"
|
||||||
path = "src/lib.rs"
|
path = "src/lib.rs"
|
||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
bitflags = "1.2"
|
bitflags = "1.3"
|
||||||
fxhash = "0.2.1"
|
fxhash = "0.2.1"
|
||||||
log = "0.4"
|
log = "0.4"
|
||||||
slab = "0.4"
|
slab = "0.4"
|
||||||
|
|
|
@ -550,7 +550,9 @@ impl TimerDriver {
|
||||||
|
|
||||||
impl Drop for TimerDriver {
|
impl Drop for TimerDriver {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
self.0.borrow_mut().stop_wheel();
|
if let Ok(mut timer) = self.0.try_borrow_mut() {
|
||||||
|
timer.stop_wheel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -608,7 +610,9 @@ impl LowresTimerDriver {
|
||||||
|
|
||||||
impl Drop for LowresTimerDriver {
|
impl Drop for LowresTimerDriver {
|
||||||
fn drop(&mut self) {
|
fn drop(&mut self) {
|
||||||
self.0.borrow_mut().stop_wheel();
|
if let Ok(mut timer) = self.0.try_borrow_mut() {
|
||||||
|
timer.stop_wheel();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue