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

Crash changing map after PIE #236

Open
vrachels opened this issue Jan 22, 2019 · 1 comment
Open

Crash changing map after PIE #236

vrachels opened this issue Jan 22, 2019 · 1 comment

Comments

@vrachels
Copy link

@vrachels vrachels commented Jan 22, 2019

Possibly started in 4.21

Playing in a map results in the map's blueprint generated class being added to the JavascriptIsolate's ClassToFunctionTemplateMap. Since this is never cleaned up, changing the map results in an assert / crash that the previously loaded map is not garbage collected.

Crash log:

LogReferenceChain: (root) JavascriptIsolate /Engine/Transient.JavascriptIsolate_1::AddReferencedObjects()
LogReferenceChain:  BlueprintGeneratedClass /Game/Maps/Blank.Blank_C::AddReferencedObjects()
LogReferenceChain:   LevelScriptBlueprint /Game/Maps/Blank.Blank:PersistentLevel.Blank->Outer
LogReferenceChain:    Level /Game/Maps/Blank.Blank:PersistentLevel->Outer
LogReferenceChain:     World /Game/Maps/Blank.Blank

Fatal error: [File: ... EditorServer.cpp] [Line: 1969] 
/Game/Maps/Blank.Blank still around while trying to load new map
(Object is not currently rooted)

Local fix that seems to work for me so far, in UJavascriptComponent::BeginDestroy(),

+       else if (JavascriptIsolate)
+       {
+               JavascriptIsolate->RemoveFromRoot();
+               JavascriptContext = nullptr;
+               JavascriptIsolate = nullptr;
+       }
@crocuis

This comment has been minimized.

Copy link
Contributor

@crocuis crocuis commented Jan 25, 2019

Can you register a pull request?

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

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.