banshee r3885 - in trunk/banshee: . src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage src/Libraries/Mtp/Mtp
- From: gburt svn gnome org
- To: svn-commits-list gnome org
- Subject: banshee r3885 - in trunk/banshee: . src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage src/Libraries/Mtp/Mtp
- Date: Tue, 6 May 2008 15:23:01 +0100 (BST)
Author: gburt
Date: Tue May 6 14:23:01 2008
New Revision: 3885
URL: http://svn.gnome.org/viewvc/banshee?rev=3885&view=rev
Log:
2008-05-06 Gabriel Burt <gabriel burt gmail com>
* src/Libraries/Mtp/Mtp/Album.cs: Be more careful with native code.
* src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/MassStorageSource.cs:
Avoid NRE.
Modified:
trunk/banshee/ChangeLog
trunk/banshee/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/MassStorageSource.cs
trunk/banshee/src/Libraries/Mtp/Mtp/Album.cs
Modified: trunk/banshee/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/MassStorageSource.cs
==============================================================================
--- trunk/banshee/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/MassStorageSource.cs (original)
+++ trunk/banshee/src/Dap/Banshee.Dap.MassStorage/Banshee.Dap.MassStorage/MassStorageSource.cs Tue May 6 14:23:01 2008
@@ -100,7 +100,7 @@
}
protected override IDeviceMediaCapabilities MediaCapabilities {
- get { return volume.Parent.MediaCapabilities ?? base.MediaCapabilities; }
+ get { return (volume.Parent == null) ? base.MediaCapabilities : volume.Parent.MediaCapabilities ?? base.MediaCapabilities; }
}
protected string IsAudioPlayerPath {
Modified: trunk/banshee/src/Libraries/Mtp/Mtp/Album.cs
==============================================================================
--- trunk/banshee/src/Libraries/Mtp/Mtp/Album.cs (original)
+++ trunk/banshee/src/Libraries/Mtp/Mtp/Album.cs Tue May 6 14:23:01 2008
@@ -84,6 +84,7 @@
{
this.device = device;
this.album = new AlbumStruct ();
+ this.album.tracks = IntPtr.Zero;
Name = name;
Artist = artist;
Genre = genre;
@@ -117,6 +118,7 @@
if (album.tracks != IntPtr.Zero) {
Marshal.FreeHGlobal (album.tracks);
+ album.tracks = IntPtr.Zero;
}
if (TrackCount == 0) {
@@ -127,13 +129,14 @@
}
if (saved) {
- saved = LIBMTP_Update_Album (device.Handle, album) == 0;
+ saved = LIBMTP_Update_Album (device.Handle, ref album) == 0;
} else {
saved = LIBMTP_Create_New_Album (device.Handle, ref album, 0) == 0;
}
if (album.tracks != IntPtr.Zero) {
Marshal.FreeHGlobal (album.tracks);
+ album.tracks = IntPtr.Zero;
}
if (!saved)
@@ -211,7 +214,7 @@
internal static extern int LIBMTP_Create_New_Album (MtpDeviceHandle handle, ref AlbumStruct album, uint parentId);
[DllImport("libmtp.dll")]
- internal static extern int LIBMTP_Update_Album (MtpDeviceHandle handle, AlbumStruct album);
+ internal static extern int LIBMTP_Update_Album (MtpDeviceHandle handle, ref AlbumStruct album);
}
[StructLayout(LayoutKind.Sequential)]
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]