Skip to content

fix(unreal): drop REN_ForceNoResetLoaders on UE 5.8 - #2366

Open
kbrizov wants to merge 1 commit into
Tencent:masterfrom
heitara:fix/unreal5.8-rename-flags
Open

kbrizov wants to merge 1 commit into
Tencent:masterfrom
heitara:fix/unreal5.8-rename-flags

Conversation

@kbrizov

@kbrizov kbrizov commented Sep 10, 2026

Copy link
Copy Markdown
Contributor

Summary

UE 5.8 deprecates REN_ForceNoResetLoaders (C4996: "Rename will no longer call ResetLoaders making this flag no longer needed … your project will no longer compile" on the next release). The plugin passes it in five Rename calls, three in JSGeneratedClass.cpp and two in PEBlueprintAsset.cpp. This PR omits the flag on 5.8 and later and keeps it on earlier engines.

Why omit rather than replace

The deprecation note suggests REN_AllowPackageLinkerMismatch. That flag is not a substitute for these call sites:

  • On 5.8 (and already on 5.7) UObject::Rename does not read REN_ForceNoResetLoaders at all, so omitting it changes nothing.
  • REN_AllowPackageLinkerMismatch does have effects: it keeps the object's linker when it is moved to another package, and on 5.8 it suppresses the new editor-only detach of a loaded object's export on an in-place rename. None of the five calls wants either. Two rename a UFunction in place within the same class (Override, Restore), one moves a function to the orphan class and already calls FLinkerLoad::InvalidateExport on it, and two rename a UEdGraph in place to <name>__Removed.
  • Engine versions before 5.x could reset loaders in Rename unless this flag was set, so the flag is kept there.

UE 5.8 deprecates REN_ForceNoResetLoaders (C4996, "Rename will no
longer call ResetLoaders making this flag no longer needed ... your
project will no longer compile" on the next release). UObject::Rename
does not read the flag on 5.8, so omitting it changes nothing there.
The suggested REN_AllowPackageLinkerMismatch is not a substitute: it
keeps the linker on a package move and skips 5.8's export detach on an
in-place rename, neither of which these call sites ask for (the one
that moves an object already calls FLinkerLoad::InvalidateExport).

The five Rename calls in JSGeneratedClass.cpp and PEBlueprintAsset.cpp
now take PUERTS_RENAME_FLAGS, a file-local macro that omits the flag on
5.8 and later and keeps REN_DontCreateRedirectors | REN_DoNotDirty |
REN_ForceNoResetLoaders on earlier engines, where Rename could still
reset loaders.
@kbrizov

kbrizov commented Sep 10, 2026

Copy link
Copy Markdown
Contributor Author

@heitara FYI

kbrizov added a commit to kbrizov/puerts that referenced this pull request Sep 10, 2026
…nt#2365 Tencent#2366)

All fork-local changes on kbrizov master (ContainerMeta constructor gate, reserved-word
escaping, ProcessMulticastDelegate gate) are superseded by the merged PRs or by Tencent's
own fixes; conflicts resolved by taking heitara's version throughout. Resulting tree is
identical to heitara master.
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

Successfully merging this pull request may close these issues.

1 participant