Welcome! Log In Create A New Profile


Crashing -- Can't find problem

Posted by diego_pmc 
Crashing -- Can't find problem
February 03, 2010 10:19AM
I'm experiencing a very odd crash and I've absolutely no idea how to fix it, maybe someone here can help me. First of all, here's my source and my homebrew directory:
- Source code (107 KB)
- Homebrew directory (4.57 MB)

Now the symptoms:
The problems occurs ONLY if I draw an image on the screen, and only when the ProcessSection() function (game.cpp) is about to return to main(). If I do not draw an image there will be no errors. Also, if you look at the destructor for the Image class (graphics.cpp) you will see that it frees the in and out buffers of the JPEG image; commenting the destructor out does not help, which means that the crash is not caused by deleting data currently in use.

Edited 1 time(s). Last edit at 02/03/2010 10:20AM by diego_pmc.
Re: Crashing -- Can't find problem
February 03, 2010 04:14PM
The = operator override for GL::Image looks suspect; it's trying to realloc buffers immediately after freeing them (why use realloc in that case?) and it looks like there's a typo that makes it realloc the inbuffer for the outbuffer.
Re: Crashing -- Can't find problem
February 04, 2010 08:50AM
I replaced realloc with maloc and fixed the typo but the problem is the same. Besides, I don't (yet) use the opertator= in any part of my code, so the problem couldn't have been caused by this. Also I commented the operator out and the problem was still there.
Sorry, only registered users may post in this forum.

Click here to login