forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Image allocating goes wrong.

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development
View previous topic :: View next topic  
Author Message
jojojoris



Joined: 30 Mar 2008
Posts: 261

PostPosted: Sun Jun 14, 2009 6:29 am    Post subject: Image allocating goes wrong. Reply with quote

Hello everyone,

I am writing a game (duhh) but i got a strange problem. If i run this program in psplink it starts well. but after i started the menu about 7 times (starting tic tac toe) the background turns black and not all images are loaded anymore. It seems it crashed when i use "free(img->data)". When i run the program from my memorstick the whole background turns black and only two of the images are shown.

When it is unable to create the images every free() crashes.

Here are my complete sources. (My sound and image files are not included)
http://school.deparmey.nl/joris/TTTAOS.zip

The sources are in the src folder.
JDF/jdf.cpp is a file wchich contains code for my own Image file format (which contains RAW uncompressed data which i can copy direct to the ram.
GFX/jgfx.cpp contains the graphical part of my code.
The other files are obvious.

Can someone see what is the cause why it crashes?
and
Why does ik work (better) in PSPLINK?

PS. I know the loadingscreen is not verry useful at this time. But it is vissible for testing purposes to see if it is just working.

PSPS. I am also not quite sure what i have to use. delete of free().
_________________
Code:
int main(){
     SetupCallbacks();
     makeNiceGame();
     sceKernelExitGame();
}
Back to top
View user's profile Send private message
Jim



Joined: 02 Jul 2005
Posts: 487
Location: Sydney

PostPosted: Sun Jun 14, 2009 9:43 pm    Post subject: Reply with quote

Almost perfect description of memory leak/heap corruption.

Jim
_________________
http://www.dbfinteractive.com
Back to top
View user's profile Send private message Visit poster's website
jojojoris



Joined: 30 Mar 2008
Posts: 261

PostPosted: Mon Jun 15, 2009 1:44 am    Post subject: Reply with quote

Jim wrote:
Almost perfect description of memory leak/heap corruption.

Jim


On another forum i asked the sam question the said i screwed all the malloc/memset/free/delete up.

I fixed it now. It runs normal now
_________________
Code:
int main(){
     SetupCallbacks();
     makeNiceGame();
     sceKernelExitGame();
}
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Development All times are GMT + 10 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group