Re: [Banshee-List] Inconsistent bug when accessing DapDevice attribute



I did some more testing on this.
I did a for loop for 10 counts trying to access the ID attribute of the DapDevice object, if an exception occurred I Sleep one second and try again. Again, I was not able to read that ID attribute even after 10 seconds.

What is really strange is that if the Dap is plugged in before banshee is run, then the exact same block of code, that reads dap.Name on one line, then dap.ID on another works fine. So it has to be something with the initializing of the DapDevice itself.

- Richard

On 7/4/07, Richard Bailey <rmjb mail com> wrote:
Hello,

I'm running into a strange bug when working on my plugin
I've attached a listener to SourceManager.SourceAdded and when it's called I test if the source passed in the EventArgs is a DapSource and work with it from there.

My strange behaviour is that I get a NullReferenceException when I access the ID property of the DapDevice object when I plugin my dap while banshee is running
but if I have my device already plugged in and THEN launch banshee, everything works fine

Is there a process that populates the DapDevice objects with information "gradually" that maybe I'm pre-stepping?

I always successfully access the Name property of the DapDevice object though.

- Richard

--
Reporter: What is your opinion on the obesity problem?
King: I prefer it to the famine problem
- Wizard of ID




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]