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

file.AsyncRead doesn't work in the Menu State. #5433

Closed
RaphaelIT7 opened this issue Apr 3, 2023 · 4 comments
Closed

file.AsyncRead doesn't work in the Menu State. #5433

RaphaelIT7 opened this issue Apr 3, 2023 · 4 comments
Labels
Can't/Won't fix The issue cannot or will not be fixed.

Comments

@RaphaelIT7
Copy link

Details

file.AsyncRead doesn't work in the Menu State. Tested on all Branches

Steps to reproduce

file.Write("example.txt", "Example") -- creating a file for testing
file.AsyncRead("example.txt", "DATA", function(_, _, status, content)
	print("Async Read: " .. status, content)
end)
print("Read: " .. file.Read("example.txt", "DATA"))

Output:

Read: Example
@unknown-gd
Copy link

Yes, I have encountered this problem, without the help of external modules it is impossible to fix it.

@robotboy655 robotboy655 added the Can't/Won't fix The issue cannot or will not be fixed. label Apr 3, 2023
@robotboy655
Copy link
Contributor

I am not interested in any menu state Lua issues. It is not meant to be used at all.

@robotboy655 robotboy655 closed this as not planned Won't fix, can't repro, duplicate, stale Apr 3, 2023
@unknown-gd
Copy link

indeed

@RaphaelIT7
Copy link
Author

I looked a bit into it, and internally it seems to work fine as it loads the file and takes up the memory for it, but it never frees it.
I noticed that the GarrysMod::Lua::Libraries::File::AsyncCycle function is missing, so I'm guessing that this is the reason why it doesn't call the callback and free the memory.

The menu state isn't meant to be used, but some might want to do something in it and file.AsyncRead can become really useful.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Can't/Won't fix The issue cannot or will not be fixed.
Projects
None yet
Development

No branches or pull requests

3 participants