http://d.puremagic.com/issues/show_bug.cgi?id=2895

           Summary: std.stream.File access violation on close() in dtor
           Product: D
           Version: 2.029
          Platform: PC
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: bugzi...@digitalmars.com
        ReportedBy: steve.te...@britseyeview.com


import std.stream;

class XXX
{
   std.stream.File _log;
   int _logLevel;
   uint _maxsize;
   uint _maxfiles;
   int _numlogs;
   bool _ok;
   int _cycle;

   this()
   {
      _log = new std.stream.File(r"d:\dcat\test.log",
std.stream.FileMode.Append);
   }

   ~this()
   {
      _log.close(); 
   }

}

void main()
{
   XXX log = new XXX();
}
/*
D:\dcat\bevutils>examp
An exception was thrown while finalizing an instance of class examp.XXX

object.Error: Access Violation
*/

The strange thing is that if I comment out any of the unused class member
variables, the problem goes away.


-- 

Reply via email to