Move Local::take() into a scope where it is guaranteed to be used
This was causing a mystery crash. Fixed.
This commit is contained in:
parent
1be45395da
commit
9be493eeaf
|
@ -28,8 +28,6 @@ macro_rules! nu_select(
|
||||||
use rustrt::task::Task;
|
use rustrt::task::Task;
|
||||||
use sync::comm::Packet;
|
use sync::comm::Packet;
|
||||||
|
|
||||||
let task: Box<Task> = Local::take();
|
|
||||||
|
|
||||||
// Is anything already ready to receive? Grab it without waiting.
|
// Is anything already ready to receive? Grab it without waiting.
|
||||||
$(
|
$(
|
||||||
if (&$rx as &Packet).can_recv() {
|
if (&$rx as &Packet).can_recv() {
|
||||||
|
@ -44,6 +42,8 @@ macro_rules! nu_select(
|
||||||
// that we started.
|
// that we started.
|
||||||
let mut started_count = 0;
|
let mut started_count = 0;
|
||||||
let packets = [ $( &$rx as &Packet, )+ ];
|
let packets = [ $( &$rx as &Packet, )+ ];
|
||||||
|
|
||||||
|
let task: Box<Task> = Local::take();
|
||||||
task.deschedule(packets.len(), |task| {
|
task.deschedule(packets.len(), |task| {
|
||||||
match packets[started_count].start_selection(task) {
|
match packets[started_count].start_selection(task) {
|
||||||
Ok(()) => {
|
Ok(()) => {
|
||||||
|
|
Loading…
Reference in New Issue