Some of my scripts now cause studio to have a memory leak and crash instantly upon opening the script, im assuming this has something to do with the new script editor…
I tried opening your place, and opening the module made my PC freeze. I don’t know what is it, but maybe you could’ve used some malicius Plug-in that’s getting you this problem. Try checking your plug-in list and check the author.
I have other scripts that also crash you, maybe il make more repo scripts. How did you manage to copy the source before it crashing studio? Also thats very odd that it wouldnt crash with the same source on a new script…
Ah ok… Odd, any script that requires the poly module also crashes when opening, so im thinking this is actually very limited and isn’t happening to everyone but me, now to figure out why its crashing. Opening this module/script was working fine for the previous 6+ months until today.
Ok so, if you copy the source into a new script, it doesn’t crash, UNTIL you save it and reopen it, then it actually does exactly what it was doing before, with the memory leak, and thus crashing, I dont think its XML related at this point.
Im going to start sectioning down the code until I can find the part that actually is causing the issue.
local function toVertexList(vertices, x,y, ...)
if not (x and y) then return vertices end -- no more arguments
vertices[#vertices + 1] = {x = x, y = y} -- set vertex
return toVertexList(vertices, ...) -- recurse
end
Paste this into any script, save it, reopen studio, open the script, bang it crashed.
I assume its because of the recursive nature of the function. I removed the function and everything is seemly working fine again. If anyone runs into this issue down the road, its probably because of a recursive function.