[banshee] Undo over-disposing
- From: Alexander Kojevnikov <alexk src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [banshee] Undo over-disposing
- Date: Mon, 15 Feb 2010 08:01:56 +0000 (UTC)
commit 3d8dfc22f535189fafd6b2db271757675853c23b
Author: Alexander Kojevnikov <alexander kojevnikov com>
Date: Mon Feb 15 19:00:33 2010 +1100
Undo over-disposing
.../Banshee.Playlists.Formats/AsxPlaylistFormat.cs | 8 +++-----
.../Banshee.Playlists.Formats/PlaylistParser.cs | 8 +++-----
2 files changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/src/Core/Banshee.Services/Banshee.Playlists.Formats/AsxPlaylistFormat.cs b/src/Core/Banshee.Services/Banshee.Playlists.Formats/AsxPlaylistFormat.cs
index 073f782..de0d008 100644
--- a/src/Core/Banshee.Services/Banshee.Playlists.Formats/AsxPlaylistFormat.cs
+++ b/src/Core/Banshee.Services/Banshee.Playlists.Formats/AsxPlaylistFormat.cs
@@ -49,10 +49,9 @@ namespace Banshee.Playlists.Formats
public static bool MagicHandler(StreamReader reader)
{
try {
- using (var xml_reader = new XmlTextReader(reader)) {
- xml_reader.WhitespaceHandling = WhitespaceHandling.None;
- return CheckAsxHeader(xml_reader);
- }
+ XmlTextReader xml_reader = new XmlTextReader(reader);
+ xml_reader.WhitespaceHandling = WhitespaceHandling.None;
+ return CheckAsxHeader(xml_reader);
} catch {
return false;
}
@@ -125,7 +124,6 @@ namespace Banshee.Playlists.Formats
}
} while(!xml_reader.EOF && xml_reader.Depth > 1);
}
- xml_reader.Close ();
}
public override void Save(Stream stream, ITrackModelSource source)
diff --git a/src/Core/Banshee.Services/Banshee.Playlists.Formats/PlaylistParser.cs b/src/Core/Banshee.Services/Banshee.Playlists.Formats/PlaylistParser.cs
index 4e81090..b081c79 100644
--- a/src/Core/Banshee.Services/Banshee.Playlists.Formats/PlaylistParser.cs
+++ b/src/Core/Banshee.Services/Banshee.Playlists.Formats/PlaylistParser.cs
@@ -128,11 +128,9 @@ namespace Banshee.Playlists.Formats
foreach (PlaylistFormatDescription format in playlist_formats) {
stream.Position = 0;
- using (var reader = new StreamReader (stream)) {
- if (format.MagicHandler (reader)) {
- matching_format = format;
- break;
- }
+ if (format.MagicHandler (new StreamReader (stream))) {
+ matching_format = format;
+ break;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]