#1 Members - Reputation: 112
Posted 19 July 2012 - 07:05 PM
Code snippets:
http://pastebin.com/aiMwqSwf
http://pastebin.com/Xzs8gSbb
EDIT: narrowed the problem down to the console class acting up, not sure where to even begin looking for errors though.
Console class: //Excuse my terrible console
http://pastebin.com/sYUYEPRa
http://pastebin.com/hvcytUqc
#3 Members - Reputation: 112
Posted 20 July 2012 - 02:32 AM
In displayConsole() (http://pastebin.com/aiMwqSwf) I commented out lines 12-20 and put another printS call that just prints a static phrase. When I do this the text stays on screen for as long as the console is open. I would think that if Issue() was being called I would watch my text scroll up the screen, but instead it vanishes as if contents itself is deleted.
Edited by VisualDistortion, 20 July 2012 - 02:34 AM.
#4 Members - Reputation: 808
Posted 20 July 2012 - 02:54 AM
#5 Members - Reputation: 112
Posted 20 July 2012 - 11:24 AM
Aside the call of displayConsole(), this is the rest of the code that interacts with the console http://pastebin.com/RA8BGaBn
#6 Members - Reputation: 149
Posted 20 July 2012 - 03:46 PM
#7 Members - Reputation: 112
Posted 20 July 2012 - 05:07 PM
SDL redirects streams from the console window to 'stdout.txt', I'm not sure if it copies the existing text too, though. In other words, if you find your missing text in that file then you just have to redirect the stream objects that you are using back to the console window.
I don't work with the console. The console I work with is a drop down console of my own design. So nothing should ever reach the windows console.
#9 Members - Reputation: 112
Posted 24 July 2012 - 12:43 AM
It is a vicious memory leak, try to free the previous SDL_Surface* of your text and recreate another one, because each update create à new surface without deleting the previous one so you've got no more memory.
I never thought a memory leak could cause an error such as this. I guess I always assumed that memory leaks would cause problems more along the line of increased memory usage or the program crashing, neither of which happened. Anyway thank you for your help.
And thanks to everyone who at the very least attempted to help, I appreciate it.






