Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Downgrade and upgrade of newly initialized resource has different data Arc inside #618

Open
technobaboo opened this issue Apr 23, 2023 · 0 comments

Comments

@technobaboo
Copy link

impl Dispatch<XdgSurface, (), WaylandState> for WaylandState {
	fn request(
		state: &mut WaylandState,
		client: &Client,
		xdg_surface: &XdgSurface,
		request: xdg_surface::Request,
		xdg_surface_data: &(),
		_dhandle: &DisplayHandle,
		data_init: &mut DataInit<'_, WaylandState>,
	) {
		match request {
			xdg_surface::Request::GetToplevel { id } => {
				let toplevel = data_init.init(id, ());
				let test_d = toplevel.downgrade();
				let test_u = test_d.upgrade().unwrap();
				let test_da = test_u.data::<()>().unwrap();
			}
		}
	}
}

is a minimal example to reproduce the problem, toplevel has a different arc pointer than test_u and test_da will panic. From what I can tell this applies to all resources.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant