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

Loading a map should make sure the old map (and all actors) are being disposed of #27

Closed
Tricky1975 opened this issue Aug 10, 2019 · 2 comments
Labels
enhancement New feature or request

Comments

@Tricky1975
Copy link
Member

Tricky1975 commented Aug 10, 2019

Due to the Garbage Collector of Lua being not entirely flawless, and some hard to clean up relations in general, I guess this should be done manually.
Perhaps it could also help if I didn't make the Actor Class in NIL refer to a parent object, but only to the Map ID... This would surely do a lot of good, and could also help the garbage collector to set some things in order... Let's just say I messed a few things up BIG way....

The way things are going now can (and actually are) causing memory leaks on the bigger run (don't worry, everything gets cleaned up as soon as NALA ends, but still, I must get this sorted out!)

@Tricky1975 Tricky1975 added the enhancement New feature or request label Aug 10, 2019
@Tricky1975 Tricky1975 added this to To do in Field via automation Aug 10, 2019
@Tricky1975 Tricky1975 added this to Open in Beta via automation Aug 10, 2019
@Tricky1975
Copy link
Member Author

I've removed a few internal NIL links, that were not really needed in the first place, and I've set this to some C# direct calls in stead. Since the Lua garbage collector (on which NIL relies) will always ignore direct C# links (it simply can't know they exist) this should make it easier on Lua to dispose the crap.... Now this does not guarantee 100% removal of all Kthura data, but at least the map itself should be disposed when no longer needed, and since that's the biggest memory eater by far, that was my primary concern.... Some tests do have to confirm this before I can close this though

@Tricky1975 Tricky1975 moved this from To do to In progress in Field Aug 11, 2019
Tricky1975 added a commit to TrickyGameTools/Kthura that referenced this issue Aug 11, 2019
- Issues with Dijkstra fixed
- A bit of optimization in the NIL glue code, this should take of PhantasarProductions/dyrt.net#27, but I cannot be sure yet!
@Tricky1975
Copy link
Member Author

Confirmed by now

Field automation moved this from In progress to Done Aug 30, 2019
Beta automation moved this from Open to Closed Aug 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Field
  
Done
Beta
  
Closed
Development

No branches or pull requests

1 participant