diff -ur ../mldonkey-2.6.4-orig/src/daemon/common/commonDownloads.mli ./src/daemon/common/commonDownloads.mli
--- ../mldonkey-2.6.4-orig/src/daemon/common/commonDownloads.mli	2005-09-06 08:35:20.000000000 +0300
+++ ./src/daemon/common/commonDownloads.mli	2005-09-07 06:31:47.000000000 +0300
@@ -57,6 +57,7 @@
     and uploader
     and block
     val create_swarmer : string -> int64 -> int64 -> swarmer
+    val remove_swarmer : CommonTypes.file -> t option -> unit
     val create : swarmer -> CommonTypes.file -> int64 -> t
     val set_verifier : t -> CommonSwarming.verification -> unit
     val set_verified : t -> (int -> int -> unit) -> unit
diff -ur ../mldonkey-2.6.4-orig/src/daemon/common/commonSwarming.ml ./src/daemon/common/commonSwarming.ml
--- ../mldonkey-2.6.4-orig/src/daemon/common/commonSwarming.ml	2005-09-06 08:35:20.000000000 +0300
+++ ./src/daemon/common/commonSwarming.ml	2005-09-07 06:31:54.000000000 +0300
@@ -100,6 +100,7 @@
   and block
   
   val create_swarmer : string -> int64 -> int64 -> swarmer
+  val remove_swarmer : CommonTypes.file -> t option -> unit
   val create : swarmer -> M.CommonTypes.file -> int64 -> t
     
   val set_verifier : t -> verification -> unit
diff -ur ../mldonkey-2.6.4-orig/src/daemon/common/commonSwarming1.ml ./src/daemon/common/commonSwarming1.ml
--- ../mldonkey-2.6.4-orig/src/daemon/common/commonSwarming1.ml	2005-09-06 08:35:20.000000000 +0300
+++ ./src/daemon/common/commonSwarming1.ml	2005-09-07 06:32:04.000000000 +0300
@@ -207,6 +207,7 @@
 (*************************************************************************)
 
 let create_swarmer _ file_size range_size = range_size
+let remove_swarmer file swarmer = begin end
   
 (*************************************************************************)
 (*                                                                       *)
diff -ur ../mldonkey-2.6.4-orig/src/daemon/common/commonSwarming2.ml ./src/daemon/common/commonSwarming2.ml
--- ../mldonkey-2.6.4-orig/src/daemon/common/commonSwarming2.ml	2005-09-06 08:35:20.000000000 +0300
+++ ./src/daemon/common/commonSwarming2.ml	2005-09-07 06:53:30.000000000 +0300
@@ -302,6 +302,23 @@
 
 (*************************************************************************)
 (*                                                                       *)
+(*                         Remove swarmer                                *)
+(*                                                                       *)
+(*************************************************************************)
+
+let remove_swarmer file file_swarmer =
+  found := 0;
+  let swarmer = match file_swarmer with None -> assert false | Some sw -> sw.t_s in
+  let list = List2.removeq file !!CommonComplexOptions.files in
+  HS.iter (fun s ->
+	List.iter (fun file ->
+		if swarmer = s then found := 1
+	) list
+  ) swarmers_by_name;
+  if !found = 0 then HS.remove swarmers_by_name swarmer
+
+(*************************************************************************)
+(*                                                                       *)
 (*                         compute_block_end (internal)                  *)
 (*                                                                       *)
 (*************************************************************************)
diff -ur ../mldonkey-2.6.4-orig/src/daemon/common/commonTypes.ml ./src/daemon/common/commonTypes.ml
--- ../mldonkey-2.6.4-orig/src/daemon/common/commonTypes.ml	2005-09-06 08:35:20.000000000 +0300
+++ ./src/daemon/common/commonTypes.ml	2005-09-07 06:48:28.000000000 +0300
@@ -847,3 +847,5 @@
     | Known_location (ip,port) -> Ip.to_string ip
     | _ -> "firewalled"
   with _ -> ""
+
+let found = ref 0
\ No newline at end of file
diff -ur ../mldonkey-2.6.4-orig/src/networks/bittorrent/bTInteractive.ml ./src/networks/bittorrent/bTInteractive.ml
--- ../mldonkey-2.6.4-orig/src/networks/bittorrent/bTInteractive.ml	2005-09-06 08:35:21.000000000 +0300
+++ ./src/networks/bittorrent/bTInteractive.ml	2005-09-07 07:01:51.000000000 +0300
@@ -332,6 +332,7 @@
       Int64Swarmer.verify_all_chunks swarmer true
 
 let op_file_cancel file =
+  Int64Swarmer.remove_swarmer (as_file file) file.file_swarmer;
   file.file_swarmer <- None;
   BTClients.file_stop file;
   remove_file file;
diff -ur ../mldonkey-2.6.4-orig/src/networks/donkey/donkeyInteractive.ml ./src/networks/donkey/donkeyInteractive.ml
--- ../mldonkey-2.6.4-orig/src/networks/donkey/donkeyInteractive.ml	2005-09-06 08:35:21.000000000 +0300
+++ ./src/networks/donkey/donkeyInteractive.ml	2005-09-07 07:01:23.000000000 +0300
@@ -1387,6 +1387,7 @@
 
   );
   file_ops.op_file_cancel <- (fun file ->
+      Int64Swarmer.remove_swarmer (as_file file) file.file_swarmer;
       file.file_swarmer <- None;
       Hashtbl.remove files_by_md4 file.file_md4;
       current_files := List2.removeq file !current_files;
diff -ur ../mldonkey-2.6.4-orig/src/networks/fileTP/fileTPInteractive.ml ./src/networks/fileTP/fileTPInteractive.ml
--- ../mldonkey-2.6.4-orig/src/networks/fileTP/fileTPInteractive.ml	2005-09-06 08:35:21.000000000 +0300
+++ ./src/networks/fileTP/fileTPInteractive.ml	2005-09-07 07:00:54.000000000 +0300
@@ -68,6 +68,7 @@
 
 let _ =
   file_ops.op_file_cancel <- (fun file ->
+      Int64Swarmer.remove_swarmer (as_file file) file.file_swarmer;
       file.file_swarmer <- None;
       remove_file file;
   );
