closing the classpath when we're done with it

Reviewed By: jeremydubreil

Differential Revision: D2757967

fb-gh-sync-id: 0888b2d
master
Sam Blackshear 9 years ago committed by facebook-github-bot-5
parent 63b57790f9
commit df97489aa1

@ -170,6 +170,8 @@ let get_models program =
let add_class cn jclass program = let add_class cn jclass program =
program.classmap <- JBasics.ClassMap.add cn jclass program.classmap program.classmap <- JBasics.ClassMap.add cn jclass program.classmap
let cleanup program =
Javalib.close_class_path program.classpath
let lookup_node cn program = let lookup_node cn program =
try try
@ -212,7 +214,9 @@ let collect_classes classmap jar_filename =
let classpath = Javalib.class_path jar_filename in let classpath = Javalib.class_path jar_filename in
let collect classmap cn = let collect classmap cn =
JBasics.ClassMap.add cn (Javalib.get_class classpath cn) classmap in JBasics.ClassMap.add cn (Javalib.get_class classpath cn) classmap in
IList.fold_left collect classmap (extract_classnames [] jar_filename) let classes = IList.fold_left collect classmap (extract_classnames [] jar_filename) in
Javalib.close_class_path classpath;
classes
let classmap_of_classpath classpath = let classmap_of_classpath classpath =

@ -42,6 +42,8 @@ val get_classmap : program -> classmap
val get_models : program -> classmap val get_models : program -> classmap
val cleanup : program -> unit
(** load a java program *) (** load a java program *)
val load_program : string -> JBasics.ClassSet.t -> DB.source_file Utils.StringMap.t -> program val load_program : string -> JBasics.ClassSet.t -> DB.source_file Utils.StringMap.t -> program

@ -165,6 +165,7 @@ let do_all_files classpath sources classes =
capture_libs never_null_matcher linereader program tenv; capture_libs never_null_matcher linereader program tenv;
if !JConfig.create_harness then Harness.create_harness proc_file_map tenv; if !JConfig.create_harness then Harness.create_harness proc_file_map tenv;
save_tenv classpath tenv; save_tenv classpath tenv;
JClasspath.cleanup program;
JUtils.log "done @." JUtils.log "done @."

Loading…
Cancel
Save