Closed Veykril closed 2 years ago
I created a 0.18 branch on top of this, PR #23
@ada-x64's change is also still necessary, except now it's a deadlock instead of a crash (and I reinvented the fix before reading these comments, oh well).
Thanks for the work! This was merged as part of gmorenz
's 0.18 PR
This wasn't working for me, so I took the time to fix it.
backtrace
``` thread 'main' panicked at 'already immutably borrowed', C:\Users\nyxma\.cargo\registry\src\github.com-1ecc6299db9ec823\atomic_refcell-0.1.8\src\lib.rs:151:23 stack backtrace: 0: std::panicking::begin_panic_handler at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a\/library\std\src\panicking.rs:498 1: core::panicking::panic_fmt at /rustc/9d1b2106e23b1abd32fce1f17267604a5102f57a\/library\core\src\panicking.rs:116 2: core::panicking::panic_displayPretty simple fix. See the commit on my fork: https://github.com/ada-x64/egui_node_graph/commit/1b2756727239e8bd37fa17ce9aa421d5a78092bf
Basically, Context was being immutably borrowed twice because we had a reference to it in the mouse variable and were passing it to CentralPanel. Redeclaring it is cheap, so, might as well.