File AICH-memory_leak-fix_Delete_broken_seeds_files.patch of Package aMule-git

--- ./src/SHAHashSet.cpp.org	2011-11-05 04:59:23.000000000 +0900
+++ ./src/SHAHashSet.cpp	2012-10-27 23:07:26.345884356 +0900
@@ -702,7 +702,7 @@
 		return false;
 	}
 			
-	FreeHashSet();
+	//FreeHashSet();
 	return true;
 }
 
--- ./src/ThreadTasks.cpp.org	2011-08-28 05:28:32.000000000 +0900
+++ ./src/ThreadTasks.cpp	2012-09-29 23:12:48.214888236 +0900
@@ -189,6 +189,7 @@
 					CFormat(wxT("Warning, failed to save AICH hashset for file: %s"))
 						% m_filename );
 			}
+			AICHHashSet->FreeHashSet();
 		}
 	}
 	
--- ./src/PartFile.cpp.org	2011-10-16 00:43:21.000000000 +0900
+++ ./src/PartFile.cpp	2012-12-11 17:44:48.845913876 +0900
@@ -1046,20 +1046,24 @@
 	
 	CFile file(seedsPath, CFile::read);
 	if (!file.IsOpened()) {
-		AddLogLineN(CFormat( _("Partfile %s (%s) has no seeds file") )
+		//AddLogLineN(CFormat( _("Partfile %s (%s) has no seeds file") )
+		// Exists but can't be opened. Should not happen. Probably permission problem, try to remove it.
+               AddLogLineN(CFormat( _("Can't read seeds file for Partfile %s (%s)") )
 			% m_partmetfilename
 			% GetFileName() );
+		CPath::RemoveFile(seedsPath);
 		return;
 	}	
 	
-		
+	bool badSeedsFile = false;
+	
 	try {
-		if (file.GetLength() <= 1) {
-			AddLogLineN(CFormat( _("Partfile %s (%s) has a void seeds file") )
-				% m_partmetfilename
-				% GetFileName() );
-			return;
-		}
+		//if (file.GetLength() <= 1) {
+		//	AddLogLineN(CFormat( _("Partfile %s (%s) has a void seeds file") )
+		//		% m_partmetfilename
+		//		% GetFileName() );
+		//	return;
+		//}
 
 		uint8 src_count = file.ReadUInt8();
 
@@ -1115,9 +1119,14 @@
 				% m_partmetfilename
 				% GetFileName()
 				% e.what() );		
+		badSeedsFile = true;
 	}
 
 	file.Close();
+	if (badSeedsFile) {
+		// If we got an exception reading it remove it.
+		CPath::RemoveFile(seedsPath);
+	}
 }		
 
 void CPartFile::PartFileHashFinished(CKnownFile* result)