Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Aug 1st, 2005, 11:14 AM   #1
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 2,190
Rep Power: 6 Sane will become famous soon enough
Send a message via MSN to Sane
Clearing Python's Memory

I've checked the Pygame docs, haven't found anything. But once all the images and sounds are loaded with Pygame, and after I'm done using them, how can I clear them from Python's memory?

Do I just kill the variable by going x = None ?

Or will that not clear the loaded image or sound from Python's memory?
Sane is offline   Reply With Quote
Old Aug 1st, 2005, 11:22 AM   #2
Berto
Programming Guru
 
Join Date: Aug 2004
Posts: 1,022
Rep Power: 6 Berto is on a distinguished road
Send a message via AIM to Berto Send a message via MSN to Berto
Look up garbage collection? thats the handle for cleaning up objkects in other languages, maybe pygame has the same thing....

Sorry cant help you more then that.
__________________
"Put your hand on a hot stove for a minute, and it seems like an hour. Sit with a pretty girl for an hour, and it seems like a minute. THAT'S relativity."

- Albert Einstein
Berto is offline   Reply With Quote
Old Aug 1st, 2005, 2:06 PM   #3
Cerulean
Professional Programmer
 
Cerulean's Avatar
 
Join Date: Apr 2005
Location: London, England
Posts: 459
Rep Power: 4 Cerulean is on a distinguished road
Should be taken care of by the garbage collector. You can free the memory and clear the name reference like so:
del varName

Last edited by Cerulean; Aug 1st, 2005 at 2:20 PM.
Cerulean is offline   Reply With Quote
Old Aug 1st, 2005, 3:35 PM   #4
Sane
Programming Guru
 
Sane's Avatar
 
Join Date: Apr 2005
Location: Waterloo, Ontario
Posts: 2,190
Rep Power: 6 Sane will become famous soon enough
Send a message via MSN to Sane
Sweet. Thanks Cerulean as always. :p
Sane is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 9:30 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC