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

fix(scripting/mono-v2): validate app domain before removing ref #2861

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DaniGP17
Copy link

Goal of this PR

Fix a crash that occurred when an export declared in lua code was executed from C# v2 from the same resource multiple times, the issue with more details is here: thorium-cfx/mono_v2_get_started#32

How is this PR achieving the goal

It seems that there are times that m_appDomain is destroyed when the script is stopped, but RemoveRef is still called a little after the C# script is destroyed, therefore RemoveRef is called when m_appDomain is null and results in the crash.
I don't know if there is a better solution for this.

This PR applies to the following area(s)

ScRT: C#

Successfully tested on

Game builds: .

Platforms: Windows

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

Fixes issues

fixes #32

@github-actions github-actions bot added ScRT: C# Issues/PRs related to either C# scripting runtimes invalid Requires changes before it's considered valid and can be (re)triaged labels Oct 12, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid Requires changes before it's considered valid and can be (re)triaged ScRT: C# Issues/PRs related to either C# scripting runtimes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Server] SIGSEGV after restarting resource with export to same resource
1 participant