Skip to content

Filling a JArray casuses "Warning: access to a non-existing object with id 0x1 (1)" #117

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

Open
MathiewMay2 opened this issue May 7, 2024 · 2 comments
Labels
question Further information is requested

Comments

@MathiewMay2
Copy link

MathiewMay2 commented May 7, 2024

I have a function that fills a JArray with the content of a a bunch of JSON files, about 6500 elements need to be placed in the JArray, but after 600 elements it gives this error "Warning: access to a non-existing object with id 0x1 (1)" is there a limit to how many elements a JArray can contain? i thought it was limited to 64 bit unsigned, this is my function

string[] mappingFiles = JsonUtil.JsonInFolder(mappingsPath)
    int i = 0
    While (i < mappingFiles.Length)
        string jsonPath = mappingsPath+"/"+mappingFiles[i]
        string[] mappingMembers = JsonUtil.PathMembers(jsonPath, ".string")
        int x = 0
        While (x < mappingMembers.Length)
            JArray.addStr(mappingHashKeys, mappingMembers[x])
            ConsoleUtil.PrintMessage(Jarray.getStr(mappingHashKeys, x))
            x += 1
        EndWhile
        i += 1
    EndWhile

Used in combination with PapyrusUtil, and i know for a fact the error does not come from PapyrusUtil since it is able to print all of the 6500 elements in the console fine the error only appears when i do JArray.addStr, same error with JMap. the JArray is defined in a separate function as "int mappingHash" and "mappingHash = JArray.object()"

@SilverIce
Copy link

SilverIce commented Jun 14, 2024

@MathiewMay2 this most likely means that that while loop takes longer than 10 seconds. I assume nobody owns/references mappingHashKeys object and JC assumes that mappingHashKeys is garbage and it gets deleted.

Does this mappingHashKeys object is owned by something? Like JDB or another container or you have retained it? - that would help

@SilverIce
Copy link

@ryobg ryobg added the question Further information is requested label Jul 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants