All images not accounted for...

BlitzPlus Forums/BlitzPlus Programming/All images not accounted for...

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Sorry to pull this old thread back up...but thought it might prove helpful :P



This:

Function delete_image(handle)

Local handlenum

If  handle<>0 Then 
	FreeImage handle
	handlenum=handle
	handle=0 
	loadedimages=loadedimages-1
	DebugLog "Freed "+handlenum+" to "+handle
Else 
	DebugLog handle+" not freed" 
EndIf 

End Function



Should be:
Function delete_image(handle)

Local handlenum

If  handle<>0 Then 
	FreeImage handle
	handlenum=handle
	handle=0 
	loadedimages=loadedimages-1
	DebugLog "Freed "+handlenum+" to "+handle
Else 
	DebugLog handle+" not freed" 
EndIf 

Return handle ;<----------right here...a Function is designed to return a value
End Function



Then when you call the function you do this:

handle = delete_image(handle)


NOT this:

delete_image(handle) : handle = 0