|
#61
|
|||
|
|||
|
>> I noticed that the scanner plugin didn't support multiple players - it
>> kept the current scan state in global variables rather than per >> client. >> I've just committed a fix for this to 7.1. R18754 > > Thanks, but can you rework that so it stores the data needed using a > method in $client? Using a global variable is bad and will lead to > memory leaks. Given its in a plugin it should probably use $client->pluginData to store stuff. |
|
#62
|
||||
|
||||
|
On Apr 14, 2008, at 2:53 PM, Triode wrote:
>>> I noticed that the scanner plugin didn't support multiple players >>> - it >>> kept the current scan state in global variables rather than per >>> client. >>> I've just committed a fix for this to 7.1. R18754 >> >> Thanks, but can you rework that so it stores the data needed using a >> method in $client? Using a global variable is bad and will lead to >> memory leaks. > > Given its in a plugin it should probably use $client->pluginData to > store > stuff. Yeah good idea. |
|
#63
|
||||
|
||||
|
Quote:
Max
__________________
Some people think the title of this song is irrelevant, but it's not irrelevant - it's a hippopotamus. |
|
#64
|
||||
|
||||
|
It's possible to do global variables like that but you have to be really careful and know when to clean up the data. It's much easier to keep all the data tied to the client object and then it goes away automatically. RandomPlay is probably full of memory leaks as well.
|
|
#65
|
||||
|
||||
|
Quote:
Cheers, Max
__________________
Some people think the title of this song is irrelevant, but it's not irrelevant - it's a hippopotamus. |
|
#66
|
||||
|
||||
|
Quote:
Max
__________________
Some people think the title of this song is irrelevant, but it's not irrelevant - it's a hippopotamus. |
|
#67
|
||||
|
||||
|
>
> andyg;291487 Wrote: >> It's possible to do global variables like that but you have to be really >> careful and know when to clean up the data. It's much easier to keep >> all the data tied to the client object and then it goes away >> automatically. RandomPlay is probably full of memory leaks as well. > > A good example of code that puts custom data into the client object > would be appreciated check out the included scrobbler plugin. That's making extensive use of pluginData. -k |
|
#68
|
||||
|
||||
|
I notice that Client:
luginData() replaces $client with Sync::masterOrSelf($client). Is this really right? I'd have thought there are many situations where you'd want to treat two clients differently, even if they do happen to be synced.Max
__________________
Some people think the title of this song is irrelevant, but it's not irrelevant - it's a hippopotamus. |
|
#69
|
||||
|
||||
|
On Apr 15, 2008, at 9:41 AM, max.spicer wrote:
> > I notice that Client: luginData() replaces $client with> Sync::masterOrSelf($client). Is this really right? I'd have thought > there are many situations where you'd want to treat two clients > differently, even if they do happen to be synced. That's a good question, for all the plugins I'm using this for now it seems to be the right thing to do. But I guess if for some reason you wanted to seek on multiple synced players at the same time you might have an issue with that. |
|
#70
|
||||
|
||||
|
Certainly when players are synced and you do a seek on any one of them, it must effect them all, or they won't be sync'd anymore.
Have no idea if this is relevant to the code you're asking about. |
![]() |
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -7. The time now is 07:20.







luginData() replaces $client with Sync::masterOrSelf($client). Is this really right? I'd have thought there are many situations where you'd want to treat two clients differently, even if they do happen to be synced.
Linear Mode

