[JASS] [vJASS] Destroying Structs

Level 16
Joined
Mar 3, 2006
Messages
1,564
JASS:
struct Data
integer HL
integer CL
integer Diff
static item IDropped
method ItemDrop takes nothing returns nothing
local Data dat = Data.allocate()
set IDropped = ItemSet[dat.HL][dat.CL + dat.Diff]
if IDropped == <ITEM_ID> then
dat.destroy
endmethod
 
method onDestroy takes nothing returns nothing
set IDropped = null
endmethod

This is just an example, but what I want to know is that onDestroy is called when I say dat.destroy

Or the question in another word how to destroy structs is it by calling the function onDestroy or writing dat.destroy in the script ?
 
Top