Skip to content

Commit

Permalink
Remove another Rc
Browse files Browse the repository at this point in the history
  • Loading branch information
emilk committed Nov 11, 2023
1 parent d439965 commit 40f0fc0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions crates/eframe/src/native/run.rs
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,6 @@ mod glow_integration {
// There is work in progress to improve the Glutin API so it has a separate Surface
// API that would allow us to just destroy a Window/Surface when suspending, see:
// https://github.com/rust-windowing/glutin/pull/1435
//

/// State that is initialized when the application is first starts running via
/// a Resumed event. On Android this ensures that any graphics state is only
Expand Down Expand Up @@ -1858,6 +1857,9 @@ mod wgpu_integration {

pub type Viewports = ViewportIdMap<Viewport>;

/// Everything needed by the immediate viewport renderer.
///
/// Wrapped in an `Rc<RefCell<…>>` so it can be re-entrantly shared via a weak-pointer.
pub struct SharedState {
viewports: Viewports,
builders: ViewportIdMap<ViewportBuilder>,
Expand All @@ -1883,7 +1885,7 @@ mod wgpu_integration {

/// Window surface state that's initialized when the app starts running via a Resumed event
/// and on Android will also be destroyed if the application is paused.
focused_viewport: Rc<RefCell<Option<ViewportId>>>,
focused_viewport: RefCell<Option<ViewportId>>,
}

impl WgpuWinitApp {
Expand All @@ -1906,7 +1908,7 @@ mod wgpu_integration {
native_options,
running: None,
app_creator: Some(app_creator),
focused_viewport: Rc::new(RefCell::new(Some(ViewportId::ROOT))),
focused_viewport: RefCell::new(Some(ViewportId::ROOT)),
}
}

Expand Down

0 comments on commit 40f0fc0

Please sign in to comment.