[balsa] More g_object_ref fallout
- From: Peter Bloomfield <peterb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [balsa] More g_object_ref fallout
- Date: Fri, 9 Feb 2018 15:56:36 +0000 (UTC)
commit 73f35740a6b9c63299bdf358f72fc33c6b46180d
Author: Peter Bloomfield <PeterBloomfield bellsouth net>
Date: Fri Feb 9 10:55:32 2018 -0500
More g_object_ref fallout
In glib-2.56, g_object_ref() propagates the type from its argument
to its return type, which can raise incompatible-pointer-type
warnings; previously it returned a gpointer, which could conceal
a coding error.
* src/main-window.c (bw_check_mailbox_done),
(bw_check_mailbox_list): make the mailbox member of
bw_pop_mbox_t a LibBalsaMailbox, so that it can accept the value
of g_object_ref(mailbox) without a warning; rename it from
'object' to 'mailbox' because, well, that's what it is.
ChangeLog | 13 +++++++++++++
src/main-window.c | 8 ++++----
2 files changed, 17 insertions(+), 4 deletions(-)
---
diff --git a/ChangeLog b/ChangeLog
index 951767f..c9935e7 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,16 @@
+2018-02-09 Peter Bloomfield <pbloomfield bellsouth net>
+
+ In glib-2.56, g_object_ref() propagates the type from its argument
+ to its return type, which can raise incompatible-pointer-type
+ warnings; previously it returned a gpointer, which could conceal
+ a coding error.
+
+ * src/main-window.c (bw_check_mailbox_done),
+ (bw_check_mailbox_list): make the mailbox member of
+ bw_pop_mbox_t a LibBalsaMailbox, so that it can accept the value
+ of g_object_ref(mailbox) without a warning; rename it from
+ 'object' to 'mailbox' because, well, that's what it is.
+
2018-02-07 Peter Bloomfield <pbloomfield bellsouth net>
* libbalsa/mailbox.c (lbm_sort): check for zero-length array.
diff --git a/src/main-window.c b/src/main-window.c
index 5d1f461..ff07a33 100644
--- a/src/main-window.c
+++ b/src/main-window.c
@@ -3206,7 +3206,7 @@ bw_check_mailbox(LibBalsaMailbox *mailbox)
}
typedef struct {
- GObject *object;
+ LibBalsaMailbox *mailbox;
GThread *thread;
gulong notify;
} bw_pop_mbox_t;
@@ -3219,9 +3219,9 @@ bw_check_mailbox_done(bw_pop_mbox_t *bw_pop_mbox)
g_debug("joined thread %p", bw_pop_mbox->thread);
}
if (bw_pop_mbox->notify > 0U) {
- g_signal_handler_disconnect(bw_pop_mbox->object, bw_pop_mbox->notify);
+ g_signal_handler_disconnect(bw_pop_mbox->mailbox, bw_pop_mbox->notify);
}
- g_object_unref(bw_pop_mbox->object);
+ g_object_unref(bw_pop_mbox->mailbox);
}
static void
@@ -3239,7 +3239,7 @@ bw_check_mailbox_list(struct check_messages_thread_info *info, GList *mailbox_li
bw_pop_mbox_t *bw_pop_mbox;
bw_pop_mbox = g_malloc0(sizeof(bw_pop_mbox_t));
- bw_pop_mbox->object = g_object_ref(mailbox);
+ bw_pop_mbox->mailbox = g_object_ref(mailbox);
libbalsa_mailbox_pop3_set_inbox(mailbox, balsa_app.inbox);
libbalsa_mailbox_pop3_set_msg_size_limit(pop3, balsa_app.msg_size_limit * 1024);
if (info->with_progress_dialog) {
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]