summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2013-01-09 15:41:43 +0100
committerMilan Crha <mcrha@redhat.com>2013-01-09 15:41:43 +0100
commit34de3edc54e632feee57c2b985c702566c7cb126 (patch)
treec2c66e25d815fa038f7766e9f8040d370936ed64
parentb782bf7c6f23ca9021d7c5fbda4c2c0fc9f57746 (diff)
downloadevolution-data-server-34de3edc54e632feee57c2b985c702566c7cb126.tar.gz
[http calendar] Ref backend inside source_changed_cb()
In certain situation, the backend can be freed while the callback is still in action, then the factory can crash inside cal_backend_http_ensure_uri() or such.
-rw-r--r--calendar/backends/http/e-cal-backend-http.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/calendar/backends/http/e-cal-backend-http.c b/calendar/backends/http/e-cal-backend-http.c
index d12fa7ad5..82e186a9e 100644
--- a/calendar/backends/http/e-cal-backend-http.c
+++ b/calendar/backends/http/e-cal-backend-http.c
@@ -783,6 +783,8 @@ source_changed_cb (ESource *source,
{
g_return_if_fail (E_IS_CAL_BACKEND_HTTP (cbhttp));
+ g_object_ref (cbhttp);
+
if (cbhttp->priv->uri != NULL) {
gboolean uri_changed;
const gchar *new_uri;
@@ -806,6 +808,8 @@ source_changed_cb (ESource *source,
g_free (old_uri);
}
+
+ g_object_unref (cbhttp);
}
static void