Browse Source

[java/cs] Make sure the libs are flushed

Cauê Waneck 10 years ago
parent
commit
e16c481474
1 changed files with 6 additions and 0 deletions
  1. 6 0
      main.ml

+ 6 - 0
main.ml

@@ -1447,12 +1447,18 @@ try
 			add_std "cpp";
 			add_std "cpp";
 			"cpp"
 			"cpp"
 		| Cs ->
 		| Cs ->
+			let old_flush = ctx.flush in
+			ctx.flush <- (fun () ->
+				com.net_libs <- [];
+				old_flush()
+			);
 			Gencs.before_generate com;
 			Gencs.before_generate com;
 			add_std "cs"; "cs"
 			add_std "cs"; "cs"
 		| Java ->
 		| Java ->
 			let old_flush = ctx.flush in
 			let old_flush = ctx.flush in
 			ctx.flush <- (fun () ->
 			ctx.flush <- (fun () ->
 				List.iter (fun (_,_,close,_,_) -> close()) com.java_libs;
 				List.iter (fun (_,_,close,_,_) -> close()) com.java_libs;
+				com.java_libs <- [];
 				old_flush()
 				old_flush()
 			);
 			);
 			Genjava.before_generate com;
 			Genjava.before_generate com;