Free an image before loading a new?

Everything else that doesn't fall into one of the other PB categories.
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

Do you have to free an image before loading a new one that has the
same image number? Or does the LoadImage command automatically free
an existing image if you use the same image number?


PB - Registered PureBasic Coder
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fweil.

Hello PB,

I did not use to freeimage before loading a new one at with the same ID. I never noticed any issue with this.

Did you find something wrong so ?

Rgrds

Francois Weil
14, rue Douer
F64100 Bayonne
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by PB.

> Did you find something wrong so ?

No problem or anything, but I just wanted to confirm if it's OK to use
pic=LoadImage(1,"pic.bmp") instead of FreeImage(1) : pic=LoadImage(1,"pic.bmp").
I was hoping there wouldn't be any memory leaks or anything, because
I haven't used images very much with PureBasic before.


PB - Registered PureBasic Coder
BackupUser
PureBasic Guru
PureBasic Guru
Posts: 16777133
Joined: Tue Apr 22, 2003 7:42 pm

Post by BackupUser »

Restored from previous forum. Originally posted by fred.

It's ok, images are automatically freed. I will update the docs.

Fred - AlphaSND
Post Reply