Page MenuHomeFeedback Tracker

GC bug in arrays
Closed, ResolvedPublic

Description

array<ClassType> arr = new array<ClassType>();

ClassType ct = new ClassType();
arr.Insert(ct);

arr.Get(0); == NULL

Reporting for Bubbles#0173 as he can't create an account right now.

Details

Severity
None
Resolution
Open
Reproducibility
Always
Operating System
Windows 10 x64
Category
Modding

Event Timeline

GrosTon1 created this task.Jan 5 2019, 2:42 AM
Geez changed the task status from New to Assigned.Jan 7 2019, 11:35 AM

Hello, please, try with the following, it will hold the reference to the object:

array<ref ClassType> arr = new array<ref ClassType>();

Is the code used within a single method? ct will hold the reference within the method but will be released when it leaves the method scope.

rVn closed this task as Resolved.Mar 29 2019, 10:10 AM
rVn claimed this task.