Free cookie consent management tool by TermsFeed Policy Generator

Changeset 2765


Ignore:
Timestamp:
02/08/10 16:58:58 (14 years ago)
Author:
epitzer
Message:

properly close test file and explicitly catch all possible exceptions (#842)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.CodeEditor/3.2/CodeEditor.cs

    r2762 r2765  
    160160        string persistencePath = Path.Combine(Path.GetTempPath(), "HeuristicLab.CodeEditor");
    161161        if (!Directory.Exists(persistencePath))
    162           Directory.CreateDirectory(persistencePath);       
    163         File.Create(Path.Combine(persistencePath, "test.tmp"));
     162          Directory.CreateDirectory(persistencePath);
     163        FileStream fs = File.Create(Path.Combine(persistencePath, "test.tmp"));
     164        fs.Close();
    164165        File.Delete(Path.Combine(persistencePath, "test.tmp"));
     166        // if we made it this far, enable on-disk parsing cache
    165167        projectContentRegistry.ActivatePersistence(persistencePath);
    166       } catch { }
     168      } catch (NotSupportedException) {
     169      } catch (IOException) {
     170      } catch (System.Security.SecurityException) {
     171      } catch (UnauthorizedAccessException) {
     172      } catch (ArgumentException) {
     173      }
    167174      projectContent = new Dom.DefaultProjectContent();
    168175      projectContent.Language = Dom.LanguageProperties.CSharp;
Note: See TracChangeset for help on using the changeset viewer.