[rhythmbox] source: protect against repeated deletion (bug #613526)
- From: Jonathan Matthew <jmatthew src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [rhythmbox] source: protect against repeated deletion (bug #613526)
- Date: Wed, 19 May 2010 08:44:13 +0000 (UTC)
commit b6fa4439d5b1e0a14d34bf5af09adf5e894208ca
Author: Jonathan Matthew <jonathan d14n org>
Date: Wed May 19 18:39:10 2010 +1000
source: protect against repeated deletion (bug #613526)
Some devices appear and disappear when plugged in, which causes the
corresponding source to be deleted twice - once when the device
disappears and once when the device open operation fails. The easy way
to fix this is just to check that a source hasn't already been deleted
when deleting it.
sources/rb-source.c | 10 ++++++++++
1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/sources/rb-source.c b/sources/rb-source.c
index 0e174e1..8bbc6d6 100644
--- a/sources/rb-source.c
+++ b/sources/rb-source.c
@@ -123,6 +123,8 @@ struct _RBSourcePrivate
RBSourceGroup *source_group;
RBPlugin *plugin;
RBSourceSearchType search_type;
+
+ gboolean deleted;
};
enum
@@ -1523,8 +1525,16 @@ void
rb_source_delete_thyself (RBSource *source)
{
RBSourceClass *klass;
+ RBSourcePrivate *priv;
g_return_if_fail (source != NULL);
+ priv = RB_SOURCE_GET_PRIVATE (source);
+ if (priv->deleted) {
+ rb_debug ("source has already been deleted");
+ return;
+ }
+ priv->deleted = TRUE;
+
klass = RB_SOURCE_GET_CLASS (source);
klass->impl_delete_thyself (source);
g_signal_emit (G_OBJECT (source), rb_source_signals[DELETED], 0);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]