/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */
+/*
+ * Copyright (C) 2011, 2012 Red Hat, Inc. (www.redhat.com)
+ * Copyright (C) 2012 Intel Corporation
+ *
+ * This program is free software; you can redistribute it and/or
+ * modify it under the terms of version 2 of the GNU Lesser General Public
+ * License as published by the Free Software Foundation.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this program; if not, write to the
+ * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+ * Boston, MA 02110-1301, USA.
+ *
+ * Authors: Milan Crha <mcrha@redhat.com>
+ * Matthew Barnes <mbarnes@redhat.com>
+ * Tristan Van Berkom <tristanvb@openismus.com>
+ */
#include <stdio.h>
#include <stdlib.h>
main_initialize ();
source = e_source_registry_ref_builtin_address_book (registry);
+ g_return_val_if_fail (source != NULL, NULL);
book_client = e_book_client_new (source, &error);
g_object_unref (source);
g_return_val_if_fail (idle->func != NULL, FALSE);
if (idle->run_in_thread) {
- GError *error = NULL;
-
- g_thread_create (idle->func, idle->data, FALSE, &error);
+ GThread *thread;
- if (error) {
- report_error ("create thread", &error);
- stop_main_loop (1);
- }
+ thread = g_thread_new (NULL, idle->func, idle->data);
+ g_thread_unref (thread);
} else {
idle->func (idle->data);
}