- Joined
- Oct 11, 2012
- Messages
- 711
Hi, guys, please see the following example, my question is also inside:
Thanks in advance.
JASS:
struct test
//Suppose this struct has everything needed
endstruct
function CallBack takes nothing returns nothing
local timer t = GetExpiredTimer()
local test a = LoadInteger(hash, GetHandleId(t), 0) //Does this make sense?
//Suppose everything else if fine, can I do the following?
call a.destroy() // Would this deallocate the instance created in "function example"?
//If not, what should I do? How to refer to the instance created in "function example"?
endfunction
function example takes nothing returns nothing
local test a = test.create()
local timer t = CreateTimer()
call SaveInteger(hash, GetHandleId(t), 0, a)
call TimerStart(t, 1, false, function CallBack)
//Suppose everything else is fine
endfunction
Thanks in advance.