Uploaded image for project: 'Lucene.Net'
  1. Lucene.Net
  2. LUCENENET-443

SpellChecker finaliser calls close regardless of if closed already

    XMLWordPrintableJSON

    Details

      Description

      The SpellChecker Class currently has no publicly visible way of accessing the closed field. It also calls close in the finaliser killing the process it is in upon GC as this can throw an exceptin. I propose two changes:

      Change the already existing method "IsClosed()" to public:
      public bool IsClosed()

      { return closed; }

      and add a check on this in the finaliser:
      ~SpellChecker()

      { if (!IsClosed()) this.Close(); }

      Ideally this class should implement IDisposable but I think this would be a bigger job than this two line change.

        Attachments

          Activity

            People

            • Assignee:
              michaelherndon michael herndon
              Reporter:
              sturobo Stuart Robinson
            • Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: