Fist Posted September 10, 2015 Posted September 10, 2015 Hello everyone. Just askin or it is possible to destroy function? Like if key Z is executed and it executes EXAMPLE function and if i press again Z it destroys that function, and over again same process.
Fist Posted September 10, 2015 Author Posted September 10, 2015 Take a look at unbindKey That would not fix my problem, i need exaclty what destroys function, cause i need it so in background doesnt run a useless gui when its not used.
Moderators IIYAMA Posted September 10, 2015 Moderators Posted September 10, 2015 function myFunctionName () end myFunctionName = nil -- delete
Fist Posted September 10, 2015 Author Posted September 10, 2015 function myFunctionName () end myFunctionName = nil -- delete doesnt work.
JR10 Posted September 10, 2015 Posted September 10, 2015 There's no such thing as "destroying" a function. Once it's bound to a command or a key, even nullifying the function's variable won't stop its execution.
Fist Posted September 10, 2015 Author Posted September 10, 2015 There's no such thing as "destroying" a function. Once it's bound to a command or a key, even nullifying the function's variable won't stop its execution. Ok, thanks anyway.
ixjf Posted September 11, 2015 Posted September 11, 2015 As long as the function is referenced somewhere, Lua's garbage collector won't remove it. You'll have to unbind the key from that function to stop it.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now