[rhythmbox] mtp: only release the device if we managed to open it



commit 627e6a50402ee8b047a65935a10e7e1ffdd870ec
Author: Jonathan Matthew <jonathan d14n org>
Date:   Tue Dec 29 18:48:15 2009 +1000

    mtp: only release the device if we managed to open it

 plugins/mtpdevice/rb-mtp-thread.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/plugins/mtpdevice/rb-mtp-thread.c b/plugins/mtpdevice/rb-mtp-thread.c
index 95af372..76bb07e 100644
--- a/plugins/mtpdevice/rb-mtp-thread.c
+++ b/plugins/mtpdevice/rb-mtp-thread.c
@@ -769,7 +769,9 @@ impl_finalize (GObject *object)
 
 	g_hash_table_destroy (thread->albums);
 
-	LIBMTP_Release_Device (thread->device);
+	if (thread->device != NULL) {
+		LIBMTP_Release_Device (thread->device);
+	}
 
 	G_OBJECT_CLASS (rb_mtp_thread_parent_class)->finalize (object);
 }



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