Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Adrian
20
Years of Service
User Offline
Joined: 11th Nov 2003
Location: My Living Room
Posted: 7th Oct 2009 04:09
Hi everyone.
I'm having a problem with my program crashing when I use animation.
I'm loading an avi file into memory and can play it nicely but after a while it crashes back to the editor. This is a very cut down version of my code to show you what the problem is. It will run about 170-180 times before it breaks. I don't understand why though. It does seem to slow down just before it breaks.
Anyone have any ideas why? Is it something to do with garbage collection?

starthere:
flush video memory
inc poi
if animation exist(1)
delete animation 1
endif
load animation "system\You Win.avi",1 : print "loaded ok "+str$(poi)
goto starthere

Thanks in advance for any help.
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 7th Oct 2009 09:28
You're not actually playing the animation? And why flush video memory anyway? It looks (To me anyway) that flushing video memory wipes the animation from memory, but as you haven't actually deleted it, it leaves the fact that there was an animation there and loads the next iteration into a separate area of memory until you fill it, and the program crashes.

Your signature has been erased by a mod because we're sadistic losers with nothing better to do. (joke)
Adrian
20
Years of Service
User Offline
Joined: 11th Nov 2003
Location: My Living Room
Posted: 7th Oct 2009 10:13
It makes no difference if I play the animation of not, the thing still doesn't work. I flush the video just in case it helped to clear the memory. I think this is a bug. It "feels" like a memory pointer isn't being reset properly. If the flush video memory command is removed, the same thing still happens, the program still crashes. The animation should be deleted each time around the loop if it exists but this isn't happening.

Have you actually tried the above code? Does it crash your machine? (obviously you have to use your own .avi file) Can anyone run the above to say, 2000 times?
BillR
21
Years of Service
User Offline
Joined: 19th Mar 2003
Location: United States
Posted: 8th Oct 2009 10:14 Edited at: 8th Oct 2009 10:22
Something strange is going on here, here is your modified code I ran



My machine, older with a 64meg video card stops after 103-104 loops.
Program Hangs, I have to use Windows Task Manager to quit program.
Windows XP Pro SP2, 1 GB RAM, GeForce 3 Ti/200 64MB

I put 'Flush Video Memory' both inside and outside the 'For' loop,
didn't seem to make any difference.
=PRoF=
21
Years of Service
User Offline
Joined: 17th Mar 2003
Location: Milton Keynes, UK
Posted: 8th Oct 2009 11:52 Edited at: 8th Oct 2009 11:54


I added some memory checks to see whats happening, and the available memory steadily decreases the more times you load the animation.

This isn't affected by deleting the animation or flushing the video memory.

Seems pretty bug-like to me

Without Music or Love the world would be a very empty place... Thank god I still have music.. --'-<@
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 8th Oct 2009 22:05
I know that animations are loaded and played externally by the built into windows activemovie.exe.

It's possible that it's that which is bugged.

Your signature has been erased by a mod because we're sadistic losers with nothing better to do. (joke)
Adrian
20
Years of Service
User Offline
Joined: 11th Nov 2003
Location: My Living Room
Posted: 10th Oct 2009 18:48
I ran the code in Dark Basic Classic and it works perfectly so I don't think it's an external problem. I managed over 2000 times around the loop before I was convinced it was ok so it must be something in DBPro.
This isn't good as I can't really use animation until it's fixed but hopefully it should be an easy fix. Hope it's looked at soon.

Thanks everyone for checking this out for me, it took me a while to figure out what was causing my program to crash and wasn't sure if it was my machine or something else.

When's the next upgrade due?

Login to post a reply

Server time is: 2024-05-17 02:42:08
Your offset time is: 2024-05-17 02:42:08