The code below compiles fine but I always get a run time abort with the error down below. Isn't the postProc at module scope so shouldn't the class instance always be around (ie not deallocated?) If it helps, this was translated from C++ code. Thanks.

---------------------file post_processor.d ----------
module post_processor;

class PostProcessor
{
    ...
    GLuint FBO;
    ....
}

---------------------file game.d -------------------
module game;

PostProcessor postProc; // just a declaration (no memory allocation)

class Game
{
    ...
    void initGame(){
        ...
        PostProcessor postProc = new PostProcessor(...);
        ...
    }
    ...
    void update(GLfloat deltaTime){
        ...
        writeln("Right Before");
        writeln("postProcesor.FBO = ", postProc.FBO);
        writeln("Right After);
        ...
    }
    ...
}


Right Before
Program exited with code -1073741819
myapp exited with code 2

Reply via email to