SourceManager: avoid warnings when shutting down (bgo#709376)
commit7ecc2fe6feac10f48293db7b52c46ea6a35cfb85
authorAndrés G. Aragoneses <knocte@gmail.com>
Thu, 3 Oct 2013 17:16:59 +0000 (3 19:16 +0200)
committerAndrés G. Aragoneses <knocte@gmail.com>
Thu, 3 Oct 2013 17:17:28 +0000 (3 19:17 +0200)
tree86589c4e0bd2a8edd3aa56a42c663dccdb2bce3a
parent876b9f077eb168da82f543d05adc2267dbbd824a
SourceManager: avoid warnings when shutting down (bgo#709376)

When shutting down banshee while a track is being played, the disposal
of the SourceManager instance was causing a NRE, which was printed as
a Warning in the console. The culprit of the NRE consisted on the class
FileSystemQueue trying to access SourceManager.MusicLibrary property
in the Dispose() method to unsubscribe from some events, but MusicLibrary
property had already been set to null by SourceManager's Dispose() method.

The solution is simply to delay the assignment of null values to these
properties to *after* the SourceManager children sources have been disposed.

This wasn't causing a crash or anything severe, but it's good that we get
rid of the noise that it was generating.
src/Core/Banshee.Services/Banshee.Sources/SourceManager.cs