找回密码
 点一下
查看: 2291|回复: 1

RemoveLocation

[复制链接]
发表于 2008-10-5 13:18:49 | 显示全部楼层 |阅读模式
提示: 作者被禁止或删除 内容自动屏蔽
发表于 2008-10-5 13:58:09 | 显示全部楼层
果然,全局变量也要设置成null
看来用VJASS的Struct的人要注意了!!
析构函数应这样写了:
[codes=jass]
struct
  location loc
  method onDestroy takes nothing returns nothing
    call RemoveLocation( this.loc )
    set this.loc = null
    call this.destroy()
  endmethod
endstruct
[/codes]
这是因为Struct其实就是用全局变量数组弄的,要是不设置成null,那肯定会有test1的下场的。

最后,支持LZ!!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 点一下

本版积分规则

Archiver|移动端|小黑屋|地精研究院

GMT+8, 2024-5-2 17:21 , Processed in 0.112132 second(s), 21 queries .

Powered by Discuz! X3.5

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表