lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From guidotag <...@git.apache.org>
Subject [GitHub] lucenenet pull request: Fixes in the Fsync method and in a helper ...
Date Wed, 28 Jan 2015 03:35:47 GMT
Github user guidotag commented on the pull request:

    https://github.com/apache/lucenenet/pull/62#issuecomment-71775809
  
    Here is my simple test to reproduce the issue:
    
    static void Main(string[] args) {          
                TestNoDispose();
                TestDispose();
                Console.ReadLine();
    }
    
    static void TestNoDispose() {
                DisposableObject obj = null;
                using (obj) {
                    obj = new DisposableObject();
                    Console.WriteLine("Should NOT dispose after this message...");
                }
    }
    
    static void TestDispose() {
                DisposableObject obj;
                using (obj = new DisposableObject()) {
                    Console.WriteLine("Should dispose after this message...");
                }
            }
    }
    
    class DisposableObject : IDisposable {
            public DisposableObject() {
                Console.WriteLine("Constructing...");
            }
            public void Dispose() {
                Console.WriteLine("Disposing...");
            }
    }


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message