[Derelict2] Code SOMETIMES seg. faults!

Andrej Mitrovic andrej.mitrovich at gmail.com
Fri May 11 10:53:14 PDT 2012


On 5/10/12, Minas <minas_mina1990 at hotmail.co.uk> wrote:
> But sometimes (at about 3-5 runs), I get a segmentation fault!

Long shot but: I've had crashes before when using write calls in an
app that doesn't spawn a console window. What happened was
stdout/stderr wasn't opened, so to fix that I'd have to do this before
any calls to write() functions:
if (!GetConsoleWindow()) {
   stdout.open("stdout.log", "w");
   stderr.open("stderr.log", "w");
}

GetConsoleWindow is a win32 function, but there's probably something
similar on posix though.


More information about the Digitalmars-d-learn mailing list