Is there anything fundamentally wrong with this code?
WhatMeWorry via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Fri Feb 3 09:20:43 PST 2017
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
More information about the Digitalmars-d-learn
mailing list