1 Return-Path: <bremner@tethera.net>
\r
2 X-Original-To: notmuch@notmuchmail.org
\r
3 Delivered-To: notmuch@notmuchmail.org
\r
4 Received: from localhost (localhost [127.0.0.1])
\r
5 by olra.theworths.org (Postfix) with ESMTP id 25EB8429E25
\r
6 for <notmuch@notmuchmail.org>; Sun, 4 Dec 2011 11:35:22 -0800 (PST)
\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org
\r
11 X-Spam-Status: No, score=-2.3 tagged_above=-999 required=5
\r
12 tests=[RCVD_IN_DNSWL_MED=-2.3] autolearn=disabled
\r
13 Received: from olra.theworths.org ([127.0.0.1])
\r
14 by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)
\r
15 with ESMTP id ajvcClmxK1JT for <notmuch@notmuchmail.org>;
\r
16 Sun, 4 Dec 2011 11:35:21 -0800 (PST)
\r
17 Received: from tempo.its.unb.ca (tempo.its.unb.ca [131.202.1.21])
\r
18 (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits))
\r
19 (No client certificate requested)
\r
20 by olra.theworths.org (Postfix) with ESMTPS id 7B2E9429E21
\r
21 for <notmuch@notmuchmail.org>; Sun, 4 Dec 2011 11:35:21 -0800 (PST)
\r
22 Received: from zancas.localnet
\r
23 (fctnnbsc36w-156034079193.pppoe-dynamic.High-Speed.nb.bellaliant.net
\r
24 [156.34.79.193]) (authenticated bits=0)
\r
25 by tempo.its.unb.ca (8.13.8/8.13.8) with ESMTP id pB4JZHrr025303
\r
26 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NO);
\r
27 Sun, 4 Dec 2011 15:35:17 -0400
\r
28 Received: from bremner by zancas.localnet with local (Exim 4.77)
\r
29 (envelope-from <bremner@tethera.net>)
\r
30 id 1RXHqG-0002Hz-OC; Sun, 04 Dec 2011 15:35:16 -0400
\r
31 From: David Bremner <david@tethera.net>
\r
32 To: notmuch@notmuchmail.org
\r
33 Subject: [PATCH] lib: call g_type_init from notmuch_database_open
\r
34 Date: Sun, 4 Dec 2011 15:35:14 -0400
\r
35 Message-Id: <1323027314-8764-1-git-send-email-david@tethera.net>
\r
36 X-Mailer: git-send-email 1.7.7.3
\r
37 In-Reply-To: <20111204182948.GU16194@mit.edu>
\r
38 References: <20111204182948.GU16194@mit.edu>
\r
39 Cc: David Bremner <bremner@debian.org>
\r
40 X-BeenThere: notmuch@notmuchmail.org
\r
41 X-Mailman-Version: 2.1.13
\r
43 List-Id: "Use and development of the notmuch mail system."
\r
44 <notmuch.notmuchmail.org>
\r
45 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,
\r
46 <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>
\r
47 List-Archive: <http://notmuchmail.org/pipermail/notmuch>
\r
48 List-Post: <mailto:notmuch@notmuchmail.org>
\r
49 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>
\r
50 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,
\r
51 <mailto:notmuch-request@notmuchmail.org?subject=subscribe>
\r
52 X-List-Received-Date: Sun, 04 Dec 2011 19:35:22 -0000
\r
54 From: David Bremner <bremner@debian.org>
\r
56 We want to make sure g_type_init is called before any GObject
\r
57 functionality is used.
\r
59 This seems to fix the segfault for me. Any other comments/experiences?
\r
61 lib/database.cc | 4 ++++
\r
62 1 files changed, 4 insertions(+), 0 deletions(-)
\r
64 diff --git a/lib/database.cc b/lib/database.cc
\r
65 index e4ef14e..98f101e 100644
\r
66 --- a/lib/database.cc
\r
67 +++ b/lib/database.cc
\r
71 #include <glib.h> /* g_free, GPtrArray, GHashTable */
\r
72 +#include <glib-object.h> /* g_type_init */
\r
74 using namespace std;
\r
76 @@ -600,6 +601,9 @@ notmuch_database_open (const char *path,
\r
80 + /* Initialize the GLib type system and threads */
\r
83 notmuch = talloc (NULL, notmuch_database_t);
\r
84 notmuch->exception_reported = FALSE;
\r
85 notmuch->path = talloc_strdup (notmuch, path);
\r