I have a table with nested tables.
When I tried to remove nested tables by using table.remove, I get (table expected, got nil) error.
I also cannot find out how many nested tables are using #tableName.
What would be the best way to completely clean nested tables (and parent table)? [import]uid: 39031 topic_id: 23869 reply_id: 323869[/import]
And just nilling out tables doesn’t seem to work because I see that the memory doesn’t get freed.
Help! [import]uid: 39031 topic_id: 23869 reply_id: 96316[/import]
Can we see some code? (don’t forget to put it in code tags:
<code>
your code here
</code>
) [import]uid: 19626 topic_id: 23869 reply_id: 96321[/import]
Here’s a part of the code.
paramT table contains 5 tables that store data.
When I am done, I want to clean data in the tables (x, y, distance, etc.)then the tables themselves(xT, yT, paramT, etc.). For some reason, table.remove won’t work.
Thanks!
local function createEnemy(i, x, y, distance, enemySpeed, initDir)
local paramT = {xT = {}, yT = {}, distanceT = {}, enemySpeedT = {}, enemyDirT ={}}
paramT.xT[i] = x
paramT.yT[i] = y
paramT.distanceT[i] = distance
paramT.enemySpeedT[i] = enemySpeed
paramT.enemyDirT[i] = initDir
...
...
...
[import]uid: 39031 topic_id: 23869 reply_id: 96348[/import]