- Joined
- Oct 11, 2012
- Messages
- 711
Hi guys, please see the following, its an example in my other posts, but the question is different:
Thanks.
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)
//Suppose everything else if fine, can I do the following?
call a.destroy() //What will happen? I have already deallocated 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)
call a.destroy()
//Suppose everything else is fine
endfunction
Thanks.