X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2Fhttp_getter%2Fhttp_getter_map.ml;h=26daa21d5f2695f5b1ddcf6c22ea933b985cb6b9;hb=12e7928b2ce2113d5ac43d453026d0443f58c5e4;hp=7a5ed1a3bc93ca1490b607f7574bd65e78acffde;hpb=e7ab167b72dc48d260d82060949e8ebe7d27764c;p=helm.git diff --git a/helm/http_getter/http_getter_map.ml b/helm/http_getter/http_getter_map.ml index 7a5ed1a3b..26daa21d5 100644 --- a/helm/http_getter/http_getter_map.ml +++ b/helm/http_getter/http_getter_map.ml @@ -40,7 +40,7 @@ class map dbname = val mutable db = open_dbm () - initializer Gc.finalise Dbm.close db (* close db on GC *) + (*initializer Gc.finalise Dbm.close db (* close db on GC *)*) method add key value = self#doWriter (lazy ( @@ -75,10 +75,18 @@ class map dbname = method clear = self#doWriter (lazy ( Dbm.close db; - Sys.remove (dbname ^ ".dir"); - Sys.remove (dbname ^ ".pag"); + List.iter + (fun ext -> + let file = dbname ^ ext in + if Sys.file_exists file then Sys.remove file) + [".dir"; ".pag"; ".db"]; db <- open_dbm () )) + method close = + self#doWriter (lazy ( + Dbm.close db + )) + end