View Single Post
03/22/15, 03:39 AM   #1
circonian
AddOn Author - Click to view addons
Join Date: May 2014
Posts: 613
SavedVariables Problem...Any Ideas?

Anyone have any ideas on this.

Whenever the function (below) runs and adds the scriptName & script to the scripts table...and then I try to reload the UI (or just wait long enough) the game crashes & the saved variable file is over 1 gig.
That is the only line of code that adds anything to the saved variables file.

Code Paste here, Line 392 is the problem: http://pastebin.com/sjnG4v9d

Or if you want/need to see the whole addon you can find it here: Drop Box Zip File

CLICK4INFO.sv -- Is my saved variables
CLICK4INFO.sv.scripts -- Is just an empty table to start out.


Lua Code:
  1. function Click4Info_AddScript(self)
  2.     local scriptName = CLICK4INFO.nameEditBox:GetText()
  3.     local script = CLICK4INFO.scriptEditBox:GetText()
  4.    
  5.     if not scriptName or scriptName == "" then return end
  6.     if not script or script == "" then return end
  7.    
  8.     -- This Msg only prints once
  9.     -- so its not infinitely looping this function
  10.     debugMsg("Adding Script")
  11.  
  12.     -- check to see if it already exists
  13.     if not DoesScriptNameExist(scriptName) then
  14.    
  15.         -- This line is the problem:
  16.         table.insert(CLICK4INFO.sv.scripts, {["scriptName"] = scriptName, ["script"] = script})
  17.     end
  18. end
  Reply With Quote