[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[GNUnet-SVN] [gnunet-gtk] 02/02: fix namestore gtk segv on exit
From: |
gnunet |
Subject: |
[GNUnet-SVN] [gnunet-gtk] 02/02: fix namestore gtk segv on exit |
Date: |
Fri, 15 Jun 2018 22:42:56 +0200 |
This is an automated email from the git hooks/post-receive script.
grothoff pushed a commit to branch master
in repository gnunet-gtk.
commit 899f2c738e7117fd5c15e78c9c530241287674e9
Author: Christian Grothoff <address@hidden>
AuthorDate: Fri Jun 15 22:42:11 2018 +0200
fix namestore gtk segv on exit
---
src/namestore/gnunet-namestore-gtk.c | 52 +++++++++++++++++++++---------------
1 file changed, 31 insertions(+), 21 deletions(-)
diff --git a/src/namestore/gnunet-namestore-gtk.c
b/src/namestore/gnunet-namestore-gtk.c
index e2150c1c..94dd8d97 100644
--- a/src/namestore/gnunet-namestore-gtk.c
+++ b/src/namestore/gnunet-namestore-gtk.c
@@ -476,7 +476,7 @@ static const struct GNUNET_CONFIGURATION_Handle *cfg;
/**
* Ongoing identity operation.
*/
-struct GNUNET_IDENTITY_Operation *iop;
+static struct GNUNET_IDENTITY_Operation *iop;
/**
* Global return value (for success/failure of gnunet-setup).
@@ -495,7 +495,8 @@ get_object (const char *name)
{
if (NULL == ml)
return NULL;
- return GNUNET_GTK_main_loop_get_object (ml, name);
+ return GNUNET_GTK_main_loop_get_object (ml,
+ name);
}
@@ -523,7 +524,8 @@ create_qrcode (unsigned int scale)
unsigned int size;
char *upper;
- qri = QRinput_new2 (0, QR_ECLEVEL_M);
+ qri = QRinput_new2 (0,
+ QR_ECLEVEL_M);
if (NULL == qri)
{
GNUNET_log_strerror (GNUNET_ERROR_TYPE_WARNING,
@@ -577,7 +579,8 @@ create_qrcode (unsigned int scale)
size = qrc->width * scale;
size += 8 - (size % 8);
pb = gdk_pixbuf_new_from_file_at_size (fn,
- size, size,
+ size,
+ size,
NULL);
GNUNET_free (fn);
if (NULL == pb)
@@ -659,7 +662,8 @@ gnunet_namestore_gtk_qr_save_as_dialog_response_cb
(GtkDialog *dialog,
pb = create_qrcode (8);
if (NULL == pb)
{
- GNUNET_log (GNUNET_ERROR_TYPE_WARNING, _("Failed to initialize QR-code
pixbuf"));
+ GNUNET_log (GNUNET_ERROR_TYPE_WARNING,
+ _("Failed to initialize QR-code pixbuf"));
return;
}
gdk_pixbuf_save (pb,
@@ -1841,8 +1845,11 @@ gnunet_namestore_gtk_popup_edit_button_activate_cb
(GtkWidget *widget,
GNUNET_break (0);
return;
}
- GNUNET_CRYPTO_hash (n_name, strlen (n_name), &name_hash);
- ri = GNUNET_CONTAINER_multihashmap_get (n2r, &name_hash);
+ GNUNET_CRYPTO_hash (n_name,
+ strlen (n_name),
+ &name_hash);
+ ri = GNUNET_CONTAINER_multihashmap_get (n2r,
+ &name_hash);
if ( (NULL == ri) ||
(off >= ri->rd_count) )
{
@@ -2301,6 +2308,7 @@ gnunet_namestore_gtk_public_key_copy_button_clicked_cb
(GtkButton *button,
static void
zone_sync_proc (void *cls)
{
+ (void) cls;
gtk_tree_view_set_model (tv,
tm);
#if HAVE_QRENCODE_H
@@ -2328,6 +2336,7 @@ zone_sync_proc (void *cls)
static void
zone_iteration_error (void *cls)
{
+ (void) cls;
clear_zone_view ();
#if HAVE_QRENCODE_H
setup_qrcode ();
@@ -2339,9 +2348,6 @@ zone_iteration_error (void *cls)
gtk_widget_show (GTK_WIDGET (get_object
("gnunet_namestore_gtk_qr_saveas_button")));
gtk_widget_show (GTK_WIDGET (get_object
("gnunet_namestore_gtk_qr_vseparator")));
#endif
- gtk_widget_show (GTK_WIDGET (status_label));
- gtk_widget_hide (GTK_WIDGET (get_object
("gnunet_namestore_gtk_scrolledwindow")));
- gtk_widget_hide (GTK_WIDGET (zone_combo_box));
}
@@ -2408,6 +2414,7 @@ zone_iteration_proc (void *cls,
GtkTreeIter sel_iter;
GtkTreePath *sel_path;
+ (void) cls;
GNUNET_NAMESTORE_zone_monitor_next (zmon,
1);
if ( (GNUNET_SYSERR == GNUNET_DNSPARSER_check_label (name)) &&
@@ -2429,7 +2436,8 @@ zone_iteration_proc (void *cls,
if (gtk_tree_selection_get_selected (sel,
NULL,
&sel_iter))
- sel_path = gtk_tree_model_get_path (tm, &sel_iter);
+ sel_path = gtk_tree_model_get_path (tm,
+ &sel_iter);
else
sel_path = NULL;
ri = GNUNET_CONTAINER_multihashmap_get (n2r,
@@ -2640,6 +2648,7 @@ load_zone (const char *name,
#if HAVE_QRENCODE_H
setup_qrcode ();
#endif
+ GNUNET_assert (NULL != n2r);
zmon = GNUNET_NAMESTORE_zone_monitor_start (cfg,
pkey,
GNUNET_YES,
@@ -2741,11 +2750,6 @@ cleanup_task (void *cls)
GNUNET_GTK_main_loop_quit (ml);
gtk_widget_show (GTK_WIDGET (status_label));
gtk_widget_hide (GTK_WIDGET (get_object
("gnunet_namestore_gtk_scrolledwindow")));
- if (NULL != zmon)
- {
- GNUNET_NAMESTORE_zone_monitor_stop (zmon);
- zmon = NULL;
- }
while (NULL != (oc = oc_head))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
@@ -2770,11 +2774,6 @@ cleanup_task (void *cls)
GNUNET_free (moc);
}
gtk_tree_store_clear (ts);
- if (NULL != namestore)
- {
- GNUNET_NAMESTORE_disconnect (namestore);
- namestore = NULL;
- }
if (NULL != pkey)
{
GNUNET_free (pkey);
@@ -2795,6 +2794,16 @@ cleanup_task (void *cls)
GNUNET_IDENTITY_disconnect (identity);
identity = NULL;
}
+ if (NULL != zmon)
+ {
+ GNUNET_NAMESTORE_zone_monitor_stop (zmon);
+ zmon = NULL;
+ }
+ if (NULL != namestore)
+ {
+ GNUNET_NAMESTORE_disconnect (namestore);
+ namestore = NULL;
+ }
if (NULL != n2r)
{
GNUNET_CONTAINER_multihashmap_iterate (n2r,
@@ -2803,6 +2812,7 @@ cleanup_task (void *cls)
GNUNET_CONTAINER_multihashmap_destroy (n2r);
n2r = NULL;
}
+ GNUNET_assert (NULL == zmon);
while (NULL != (tld = tld_head))
{
GNUNET_CONTAINER_DLL_remove (tld_head,
--
To stop receiving notification emails like this one, please contact
address@hidden