PDA

View Full Version : Memory Leak



Voltrox
23-12-2006, 07:05 PM
Hello.

I am having a serious memory leak problem, and my media player is sucking up lots of memory over time.

Does BASS have an OnStop event or anything like that?

Because I don't know how to tell programmatically when it has stopped playing the song.

Could someone please help me?

dmantione
23-12-2006, 08:03 PM
If you were so wise to keep your code compiler independant: compile it with FPC, and use -gh, at program exit, all memory leaks will be printed, along with their locations in source code.

AthenaOfDelphi
23-12-2006, 08:03 PM
Nicholas,

You can find a suggestion on the BASS forums (A quick google got me to the site of the company that makes BASS and a quick search of their forums found the suggestion).

Admittedly, the code isn't Pascal, but it should give you the way of doing it.

This has been said before.. please try and search for the answers on-line. You seem to hit a problem and just post on here, which whilst the whole point of a developers community is to get the input of others, I'm sure I'm not the only person who will tell you that you will learn so much more by doing your own research and testing rather than simply posting a request for assistance.

I'll typically spend hours and hours tinkering around, reading, coding, cursing ;-) Literally, I will exhaust every possibility I can think of before I ask for help. Some may consider that a waste of time if I could get an answer without having to do anything, but I've learned so much this way.

A pointer to the answer is here (http://www.un4seen.com/forum/?topic=5645.0;hl=stop).

In essence, what that post says is that you link a callback to a stream once you've created it using the method BASS_ChannelSetSync.

Voltrox
23-12-2006, 09:12 PM
When I clicked that link it went to the un4seen home page, so I can't see the post.

What do I do after the SetSync thing to figure out if its still plying?

tanffn
24-12-2006, 09:48 AM
AthenaOfDelphi, I doné─˘t think your wise suggestion passed..
Voltrox, in un4seen forum look for the topic "Event for playback stopped". you can also read in the API/Help for the BASS_ChannelSetSync method.