Skip to content

Dropping Root outside Runtime.run panics #28

Open
@Grinshpon

Description

@Grinshpon

In a project, I have a state struct that contains a glsp runtime and a struct that holds callbacks:

struct Callbacks {
  //various callbacks of type: Option<Root<GFn>>
}

struct State {
  callbacks: Callbacks,
  runtime: Runtime,
  ...
}

At the very end of the program, when the state is dropped, it panics with the error: a Root or Gc has outlived its originating Runtime - aborting process

I then tried manually dropping the callbacks before the end of the program, and it seems the panic occurs there, so it looks like I can't drop Roots unless I'm in a runtime environment. Is this intentional?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions