SDL + Memory Problems!

Discussion in 'Mac Programming' started by slooksterPSV, Jan 2, 2006.

  1. macrumors 68030

    slooksterPSV

    Joined:
    Apr 17, 2004
    Location:
    Nowheresville
    #1
    I'm having huge Memory problems with SDL in making a frogger game. I'm not sure where they are coming from, but I'll post a ZIP file with all the files I am using to show you. .... Ok I found out where it's coming from. In my Game() loop I have it making a thread over and over and over again to draw the lily and move it a certain number away and that. If I put a while look, waiting for the game to end, then it doesn't draw it correctly and makes it flash - I'll still upload the project with the memory usage thing. But how can I make it run through an SDL_Thread without having to make it again and again. This is where my memory leak must be at - even though it shows only 2 threads running. I want to use a thread because I want the game to flow smoothly. Here's the source code files of mine.
     

    Attached Files:

  2. thread starter macrumors 68030

    slooksterPSV

    Joined:
    Apr 17, 2004
    Location:
    Nowheresville
    #2
    Oh I think I got it, I just added SDL_WaitThread(lily, NULL); before return 0 in the thread function. Wow I'm good.
     

Share This Page