Skip to content

feat: add TWeakObjectPtr support in TypeScript via UE.MakeWeakObjectPtr - #2346

Merged
chexiongsheng merged 1 commit into
Tencent:masterfrom
zfyu222:master
Jul 1, 2026
Merged

chexiongsheng merged 1 commit into
Tencent:masterfrom
zfyu222:master

Conversation

@zfyu222

@zfyu222 zfyu222 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor
  • Add FWeakObjectPtrWrapper class (WeakObjectPtrWrapper.h/.cpp) exposing Get()/IsValid() methods
  • Integrate into FJsEnvImpl: WeakObjectPtrTemplate, MakeWeakObjectPtr binding
  • Register UE.MakeWeakObjectPtr in uelazyload.js bootstrap
  • Add WeakObjectPtr interface and MakeWeakObjectPtr function to puerts.d.ts type declarations
  • Null/PendingKill/invalid arguments return an inert WeakObjectPtr (IsValid=false, Get=undefined)

- Add FWeakObjectPtrWrapper class (WeakObjectPtrWrapper.h/.cpp) exposing Get()/IsValid() methods
- Integrate into FJsEnvImpl: WeakObjectPtrTemplate, MakeWeakObjectPtr binding
- Register UE.MakeWeakObjectPtr in uelazyload.js bootstrap
- Add WeakObjectPtr<T> interface and MakeWeakObjectPtr function to puerts.d.ts type declarations
- Null/PendingKill/invalid arguments return an inert WeakObjectPtr (IsValid=false, Get=undefined)
@zfyu222

zfyu222 commented Jun 30, 2026

Copy link
Copy Markdown
Contributor Author

UE开发中,WeakObjectPtr是很实用的功能,我们之前项目的lua脚本大规模使用。
让程序更安全,并且也避免内存泄露。

@chexiongsheng
chexiongsheng merged commit 74f94d3 into Tencent:master Jul 1, 2026
11 of 12 checks passed
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.

2 participants