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



Hey Patrick,

Here's a pastebin of the method: http://pastebin.ca/606206

The context that this is called is when a SourceManager.SourceAdded event happens a method in my plugin checks if the source is a DapSource, and if it is calls this AddDap method with the DapDevice in the DapSource.

The exception is thrown when dap.ID is accessed, but I already access dap.Name before this so the dap object exists.

As I said before, if banshee is running and the Dap is plugged in the error happens, but if the Dap is plugged in then banshee is launched, the code works flawlessly.

I'll post the stack trace when I get home.

- Richard

On 7/6/07, Patrick van Staveren <trick vanstaveren us > wrote:
Richard,

Suppose you can show me the code you're using?  Drop me a tarball (off
the list, of course).  Or post a snip to pastebin.  Also drop a full
stacktrace (in --debug mode so we get line numbers, please :)

If you're talking about (string) DapDevice.ID...there's only a few code
paths that could lead to it being null, so it should be easy to track
down :)

Cheers,
Patrick


On Thu, 2007-07-05 at 22:25 -0400, Richard Bailey wrote:
> 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
>
>
> _______________________________________________
> Banshee-list mailing list
> Banshee-list gnome org
> http://mail.gnome.org/mailman/listinfo/banshee-list
--
Patrick "Trick" van Staveren
http://trick.vanstaveren.us/

_______________________________________________
Banshee-list mailing list
Banshee-list gnome org
http://mail.gnome.org/mailman/listinfo/banshee-list



--
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]