-
Notifications
You must be signed in to change notification settings - Fork 25
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
Multithread singletons #46
Comments
I have a feeling you're going to run into a lot of issues with accessing foreign threads in Nim. Might want to take a look at the Nim docs around - |
This is not about accessing foreign threads, but rather accessing Godot from threads created in Nim. This is currently not supported, but should be easy to implement by changing |
That's exactly what I did. The program is running just fine, but I'm concerned about memory leaks. I'm using a |
I think that can be considered a bug in Nim - it doesn't run finalizers before deallocating thread's GC memory. It also doesn't do that in I'd recommend calling |
Added issue in Nim repo about calling finalizers on thread exit: nim-lang/Nim#12192 |
Using deallocHeap is not working for me. On exit it throws the following error:
|
I'm trying to access the VisualServer from a thread I created. So I'm using a code like this:
When I run the code, I have the following error:
Apparently when a new thread is created the visual server class is not registered (in the new thread context), and since the singleton is a threadvar, it is
nil
and can't be used.Is there a way to solve this?
The text was updated successfully, but these errors were encountered: