From 4524cb31e2c57b8de096c962dcbe45bc668a357c Mon Sep 17 00:00:00 2001 From: Thinkofname Date: Sun, 20 Mar 2016 12:21:10 +0000 Subject: [PATCH] Fix panics on shutdown (Fixes #15) --- src/chunk_builder.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/chunk_builder.rs b/src/chunk_builder.rs index ebcda08..2622a64 100644 --- a/src/chunk_builder.rs +++ b/src/chunk_builder.rs @@ -79,7 +79,10 @@ fn build_func(id: usize, textures: Arc>, work_rec let BuildReq { snapshot, position, - } = work_recv.recv().unwrap(); + } = match work_recv.recv() { + Ok(val) => val, + Err(_) => return, + }; let mut solid_buffer = vec![]; let mut solid_count = 0;