Sorry for double post but I've just tested mr Handy's extremely useful snippet.
His method runs without a leak as he says - but only if you use the apparently unnecessary
set vertex shader off and
set pixel shader off commands. If you comment out those two lines then the leak is very obvious in Task Manager - and also shows when I use my previously favourite way of clearing a shader (i.e. texture object objID, imageID).
His snippet also confirms what Mage was saying - that if you delete things in the right way then problems don't arise. That may be true but how does the casual user know what needs deleting or the best way to do it? I don't think I'm a casual user and this is the first occasion I've seen a need for those two set shader commands.
So, summarising all this, I think everyone is right:
-
mr Handy is correct to say there is no problem - but only if you follow
Mage's advice and do things the right way
-
Mage is right to suggest you need to do things right
-
Stab in the Dark software is right to suggest there's a problem if you do things the obvious way (as I have done in the past).
Stab in the Dark software
This still leaves the question of what you think is wrong with
mr Handy's snippet - which, with trivial changes, shows both the problem and a solution along the lines I requested.
Have I missed something?
Here's the version of mr Handy's code which I used:
` mr Handy's snippet from this thread
` http://forum.thegamecreators.com/?m=forum_view&t=214408&b=1
`
set display mode desktop width(), desktop height(),32,1
sync on
sync rate 0
backdrop on
`hide mouse
autocam off
position camera 0,0,-150
global SteelTex as integer : SteelTex = 1
global SteelTexN as integer : SteelTexN = 2
load image "media\floor.dds", SteelTex
load image "media\floor_n.dds", SteelTexN
make object box 1,500,1,500
position object 1,0,-45,0
texture object 1, 0, SteelTex
texture object 1, 1, SteelTexN
texture object 1, 2, SteelTex
scale object texture 1,5,5
load effect "media\reliefmapping.fx",1,0
set object effect 1, 1
do
`set pixel shader off 1 ` memory leak occurs when these two lines are omitted
`set vertex shader off 1
delete effect 1
delete image SteelTex
delete image SteelTexN
delete object 1
make object box 1,500,1,500
position object 1,0,-45,0
load image "media\floor.dds", SteelTex
load image "media\floor_n.dds", SteelTexN
texture object 1, 0, SteelTex
texture object 1, 1, SteelTexN
texture object 1, 2, SteelTex
scale object texture 1,5,5
load effect "media\reliefmapping.fx",1,0
set object effect 1, 1
inc rst
text 0,0,str$(screen fps())
text 0,20, "resets done: "+str$(rst)
sync
loop