[Derelict2] Code SOMETIMES seg. faults!

Minas minas_mina1990 at hotmail.co.uk
Thu May 10 12:08:04 PDT 2012


Well, my code is really simple, compiles and runs fine.

[code]
import std.stdio;

import derelict.sdl.sdl;

void main()
{
	DerelictSDL.load();
	
	int val = SDL_Init(SDL_INIT_EVERYTHING);
	writeln(val);
	
	SDL_Surface *screen = SDL_SetVideoMode(640, 480, 32, 
SDL_SWSURFACE);
}
[/code]

But sometimes (at about 3-5 runs), I get a segmentation fault!

0
bash: line 1: 12951 Segmentation fault      (core dumped) 
/home/minas/Projects/OpenGL/D_template/D_template/bin/Debug/D_template

0 is the return value of SDL_Init, so everything ok here. I don't 
know why this is happening? Has anyone had a similar problem?


More information about the Digitalmars-d-learn mailing list