Parcourir la source

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 il y a 8 ans
Parent
commit
e9c5dc6e16
1 fichiers modifiés avec 3 ajouts et 0 suppressions
  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) {