瀏覽代碼

Fix a refcount bug in the entity dictionary.

legacy
Sam Hocevar sam 14 年之前
父節點
當前提交
be70a70eaa
共有 1 個檔案被更改,包括 10 行新增1 行删除
  1. +10
    -1
      src/dict.cpp

+ 10
- 1
src/dict.cpp 查看文件

@@ -40,8 +40,10 @@ public:

~DictData()
{
#if !FINAL_RELEASE
if (nentities)
fprintf(stderr, "ERROR: still %i entities in dict\n", nentities);
#endif
free(entities);
}

@@ -103,8 +105,15 @@ int Dict::MakeSlot(char const *name)
void Dict::RemoveSlot(int id)
{
if (Ticker::Unref(data->entities[id]) == 0)
{
data->entities[id] = NULL;
data->nentities--;
if (data->nentities)
data->nentities--;
#if !FINAL_RELEASE
else
fprintf(stderr, "ERROR: removing entity from empty dict\n");
#endif
}
}




Loading…
取消
儲存