瀏覽代碼

Fixed instance maps not being freed
* Follow up to 2cfb844.
* Resolves instance maps not getting freed when the instance is destroyed.
Thanks to @Akkarinage!

aleos89 8 年之前
父節點
當前提交
e9c5dc6e16
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      src/map/instance.c

+ 3 - 0
src/map/instance.c

@@ -602,6 +602,9 @@ int instance_destroy(unsigned short instance_id)
 			map_delinstancemap(im->map[i]->m);
 			ers_free(instance_maps_ers, im->map[i]);
 		}
+		im->cnt_map = 0;
+		aFree(im->map);
+		im->map = NULL;
 	}
 
 	if(im->keep_timer != INVALID_TIMER) {