Browse Source

reset cl_descendants in macro context.
fixes potential memory leak

Aleksandr Kuzmenko 5 years ago
parent
commit
45809b90c9
1 changed files with 1 additions and 0 deletions
  1. 1 0
      src/typing/macroContext.ml

+ 1 - 0
src/typing/macroContext.ml

@@ -440,6 +440,7 @@ and flush_macro_context mint ctx =
 			c.cl_restore <- (fun() ->
 			c.cl_restore <- (fun() ->
 				c.cl_meta <- meta;
 				c.cl_meta <- meta;
 				c.cl_path <- path;
 				c.cl_path <- path;
+				c.cl_descendants <- [];
 				Option.may (fun fn -> fn()) ctor_restore;
 				Option.may (fun fn -> fn()) ctor_restore;
 				List.iter (fun fn -> fn()) field_restores;
 				List.iter (fun fn -> fn()) field_restores;
 				List.iter (fun fn -> fn()) static_restores;
 				List.iter (fun fn -> fn()) static_restores;