From 74bbf010142e529bf31572f581c2d79db9004c5e Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sun, 2 Jun 2019 13:00:30 -0700 Subject: [PATCH] fix 'already borrowed' panic with large pastes --- src/frontend/glium/glutinloop.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/frontend/glium/glutinloop.rs b/src/frontend/glium/glutinloop.rs index 06e112b2e..7f51f6776 100644 --- a/src/frontend/glium/glutinloop.rs +++ b/src/frontend/glium/glutinloop.rs @@ -327,8 +327,12 @@ impl GuiEventLoop { } } + fn pop_gui_thread_send(&self) -> Option { + self.gui_thread_sends.borrow_mut().pop_front() + } + fn process_gui_exec(&self) -> Result<(), Error> { - while let Some(func) = self.gui_thread_sends.borrow_mut().pop_front() { + while let Some(func) = self.pop_gui_thread_send() { func(); }