Changeset 1643 for branches/eraser6/6.0


Ignore:
Timestamp:
1/22/2010 6:51:06 AM (5 years ago)
Author:
lowjoel
Message:

Fixed crash when we try to close open handles and where no handles were found to match the file in use, leading to us doing a substring on a string which is blank.

Location:
branches/eraser6/6.0/Eraser.Manager
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • branches/eraser6/6.0/Eraser.Manager/DirectExecutor.cs

    r1637 r1643  
    799799                            processes.Add(System.Diagnostics.Process.GetProcessById(handle.ProcessId)); 
    800800 
    801                     StringBuilder processStr = new StringBuilder(); 
    802                     foreach (System.Diagnostics.Process process in processes) 
    803                         processStr.AppendFormat(System.Globalization.CultureInfo.InvariantCulture, 
    804                             "{0}, ", process.MainModule.FileName); 
     801                    string lockedBy = null; 
     802                    if (processes.Count > 0) 
     803                    { 
     804                        StringBuilder processStr = new StringBuilder(); 
     805                        foreach (System.Diagnostics.Process process in processes) 
     806                            processStr.AppendFormat(System.Globalization.CultureInfo.InvariantCulture, 
     807                                "{0}, ", process.MainModule.FileName); 
     808 
     809                        lockedBy = S._("(locked by {0})", processStr.ToString().Remove(processStr.Length - 2)); 
     810                    } 
    805811 
    806812                    task.Log.LastSessionEntries.Add(new LogEntry(S._( 
    807                         "Could not force closure of file \"{0}\" (locked by {1})", 
    808                         paths[i], processStr.ToString().Remove(processStr.Length - 2)), LogLevel.Error)); 
     813                        "Could not force closure of file \"{0}\" {1}", paths[i], 
     814                        lockedBy == null ? string.Empty : lockedBy).Trim(), LogLevel.Error)); 
    809815                } 
    810816                finally 
  • branches/eraser6/6.0/Eraser.Manager/Strings.en.resx

    r1319 r1643  
    163163    <value>The file {0} could not be erased because the file's permissions prevent access to the file.</value> 
    164164  </data> 
    165   <data name="Could not force closure of file \&quot;{0}\&quot; (locked by {1})" xml:space="preserve"> 
    166     <value>Could not force closure of file \"{0}\" (locked by {1})</value> 
     165  <data name="(locked by {0})" xml:space="preserve"> 
     166    <value>(locked by {0})</value> 
     167  </data> 
     168  <data name="Could not force closure of file \&quot;{0}\&quot; {1}" xml:space="preserve"> 
     169    <value>Could not force closure of file \&quot;{0}\&quot; {1}</value> 
    167170  </data> 
    168171  <data name="Removing folders..." xml:space="preserve"> 
  • branches/eraser6/6.0/Eraser.Manager/Strings.it.resx

    r1345 r1643  
    163163    <value>Il file {0} non può essere pulito perchè i permessi su di esso ne impediscono l'accesso.</value> 
    164164  </data> 
    165   <data name="Could not force closure of file \&quot;{0}\&quot; (locked by {1})" xml:space="preserve"> 
    166     <value>Impossibile forzare la chiusura del file \"{0}\" (bloccato da {1})</value> 
     165  <data name="(locked by {0})" xml:space="preserve"> 
     166    <value>(Untranslated)</value> 
     167  </data> 
     168  <data name="Could not force closure of file \&quot;{0}\&quot; {1}" xml:space="preserve"> 
     169    <value>(Untranslated)</value> 
    167170  </data> 
    168171  <data name="Removing folders..." xml:space="preserve"> 
  • branches/eraser6/6.0/Eraser.Manager/Strings.nl.resx

    r1319 r1643  
    163163    <value>(Untranslated)</value> 
    164164  </data> 
    165   <data name="Could not force closure of file \&quot;{0}\&quot; (locked by {1})" xml:space="preserve"> 
     165  <data name="(locked by {0})" xml:space="preserve"> 
     166    <value>(Untranslated)</value> 
     167  </data> 
     168  <data name="Could not force closure of file \&quot;{0}\&quot; {1}" xml:space="preserve"> 
    166169    <value>(Untranslated)</value> 
    167170  </data> 
  • branches/eraser6/6.0/Eraser.Manager/Strings.resx

    r1319 r1643  
    163163    <value>The file {0} could not be erased because the file's permissions prevent access to the file.</value> 
    164164  </data> 
    165   <data name="Could not force closure of file \&quot;{0}\&quot; (locked by {1})" xml:space="preserve"> 
    166     <value>Could not force closure of file \"{0}\" (locked by {1})</value> 
     165  <data name="(locked by {0})" xml:space="preserve"> 
     166    <value>(locked by {0})</value> 
     167  </data> 
     168  <data name="Could not force closure of file \&quot;{0}\&quot; {1}" xml:space="preserve"> 
     169    <value>Could not force closure of file \"{0}\" {1}</value> 
    167170  </data> 
    168171  <data name="Removing folders..." xml:space="preserve"> 
Note: See TracChangeset for help on using the changeset viewer.