aboutsummaryrefslogtreecommitdiff
path: root/src/ui
diff options
context:
space:
mode:
Diffstat (limited to 'src/ui')
-rw-r--r--src/ui/accounts.c10
-rw-r--r--src/ui/contacts.c2
-rw-r--r--src/ui/delete_messages.c2
-rw-r--r--src/ui/invite_contact.c2
-rw-r--r--src/ui/messenger.c1
-rw-r--r--src/ui/new_account.c2
-rw-r--r--src/ui/new_contact.c6
-rw-r--r--src/ui/new_group.c2
-rw-r--r--src/ui/new_lobby.c6
-rw-r--r--src/ui/new_platform.c2
-rw-r--r--src/ui/send_file.c2
-rw-r--r--src/ui/settings.c4
12 files changed, 26 insertions, 15 deletions
diff --git a/src/ui/accounts.c b/src/ui/accounts.c
index 969c23d..84e932e 100644
--- a/src/ui/accounts.c
+++ b/src/ui/accounts.c
@@ -95,11 +95,11 @@ handle_dialog_destroy(UNUSED GtkWidget *window,
95{ 95{
96 MESSENGER_Application *app = (MESSENGER_Application*) user_data; 96 MESSENGER_Application *app = (MESSENGER_Application*) user_data;
97 97
98 ui_accounts_dialog_cleanup(&(app->ui.accounts)); 98 if ((app->ui.accounts.show_queued) ||
99 (gtk_widget_is_visible(GTK_WIDGET(app->ui.messenger.main_window))))
100 return;
99 101
100 if ((!(app->ui.accounts.show_queued)) && 102 gtk_widget_destroy(GTK_WIDGET(app->ui.messenger.main_window));
101 (!gtk_widget_is_visible(GTK_WIDGET(app->ui.messenger.main_window))))
102 gtk_widget_destroy(GTK_WIDGET(app->ui.messenger.main_window));
103} 103}
104 104
105static int 105static int
@@ -219,5 +219,5 @@ ui_accounts_dialog_cleanup(UI_ACCOUNTS_Handle *handle)
219{ 219{
220 g_object_unref(handle->builder); 220 g_object_unref(handle->builder);
221 221
222 handle->accounts_listbox = NULL; 222 memset(handle, 0, sizeof(*handle));
223} 223}
diff --git a/src/ui/contacts.c b/src/ui/contacts.c
index 68d18b4..5898fde 100644
--- a/src/ui/contacts.c
+++ b/src/ui/contacts.c
@@ -241,5 +241,5 @@ ui_contacts_dialog_cleanup(UI_CONTACTS_Handle *handle)
241{ 241{
242 g_object_unref(handle->builder); 242 g_object_unref(handle->builder);
243 243
244 handle->contacts_listbox = NULL; 244 memset(handle, 0, sizeof(*handle));
245} 245}
diff --git a/src/ui/delete_messages.c b/src/ui/delete_messages.c
index 300c42e..1d6b812 100644
--- a/src/ui/delete_messages.c
+++ b/src/ui/delete_messages.c
@@ -149,4 +149,6 @@ void
149ui_delete_messages_dialog_cleanup(UI_DELETE_MESSAGES_Handle *handle) 149ui_delete_messages_dialog_cleanup(UI_DELETE_MESSAGES_Handle *handle)
150{ 150{
151 g_object_unref(handle->builder); 151 g_object_unref(handle->builder);
152
153 memset(handle, 0, sizeof(*handle));
152} 154}
diff --git a/src/ui/invite_contact.c b/src/ui/invite_contact.c
index 272550f..8d410bc 100644
--- a/src/ui/invite_contact.c
+++ b/src/ui/invite_contact.c
@@ -233,5 +233,5 @@ ui_invite_contact_dialog_cleanup(UI_INVITE_CONTACT_Handle *handle)
233{ 233{
234 g_object_unref(handle->builder); 234 g_object_unref(handle->builder);
235 235
236 handle->contacts_listbox = NULL; 236 memset(handle, 0, sizeof(*handle));
237} 237}
diff --git a/src/ui/messenger.c b/src/ui/messenger.c
index 270360d..633920c 100644
--- a/src/ui/messenger.c
+++ b/src/ui/messenger.c
@@ -275,6 +275,7 @@ handle_main_window_destroy(UNUSED GtkWidget *window,
275 MESSENGER_Application *app = (MESSENGER_Application*) user_data; 275 MESSENGER_Application *app = (MESSENGER_Application*) user_data;
276 276
277 ui_messenger_cleanup(&(app->ui.messenger)); 277 ui_messenger_cleanup(&(app->ui.messenger));
278 ui_accounts_dialog_cleanup(&(app->ui.accounts));
278 279
279 application_exit(app, MESSENGER_QUIT); 280 application_exit(app, MESSENGER_QUIT);
280} 281}
diff --git a/src/ui/new_account.c b/src/ui/new_account.c
index 6642261..2778825 100644
--- a/src/ui/new_account.c
+++ b/src/ui/new_account.c
@@ -188,4 +188,6 @@ void
188ui_new_account_dialog_cleanup(UI_NEW_ACCOUNT_Handle *handle) 188ui_new_account_dialog_cleanup(UI_NEW_ACCOUNT_Handle *handle)
189{ 189{
190 g_object_unref(handle->builder); 190 g_object_unref(handle->builder);
191
192 memset(handle, 0, sizeof(*handle));
191} 193}
diff --git a/src/ui/new_contact.c b/src/ui/new_contact.c
index 6438331..7d5d395 100644
--- a/src/ui/new_contact.c
+++ b/src/ui/new_contact.c
@@ -393,8 +393,6 @@ ui_new_contact_dialog_cleanup(UI_NEW_CONTACT_Handle *handle)
393 if (0 != handle->idle_processing) 393 if (0 != handle->idle_processing)
394 g_source_remove(handle->idle_processing); 394 g_source_remove(handle->idle_processing);
395 395
396 handle->idle_processing = 0;
397
398 g_signal_handler_disconnect( 396 g_signal_handler_disconnect(
399 handle->id_drawing_area, 397 handle->id_drawing_area,
400 handle->id_draw_signal 398 handle->id_draw_signal
@@ -405,8 +403,8 @@ ui_new_contact_dialog_cleanup(UI_NEW_CONTACT_Handle *handle)
405 if (handle->image) 403 if (handle->image)
406 zbar_image_destroy(handle->image); 404 zbar_image_destroy(handle->image);
407 405
408 handle->image = NULL;
409
410 zbar_image_scanner_destroy(handle->scanner); 406 zbar_image_scanner_destroy(handle->scanner);
411 zbar_video_destroy(handle->video); 407 zbar_video_destroy(handle->video);
408
409 memset(handle, 0, sizeof(*handle));
412} 410}
diff --git a/src/ui/new_group.c b/src/ui/new_group.c
index d2b287e..6b60145 100644
--- a/src/ui/new_group.c
+++ b/src/ui/new_group.c
@@ -313,4 +313,6 @@ ui_new_group_dialog_cleanup(UI_NEW_GROUP_Handle *handle)
313 313
314 if (handle->contact_entries) 314 if (handle->contact_entries)
315 g_list_free(handle->contact_entries); 315 g_list_free(handle->contact_entries);
316
317 memset(handle, 0, sizeof(*handle));
316} 318}
diff --git a/src/ui/new_lobby.c b/src/ui/new_lobby.c
index 0a9fe37..e75c371 100644
--- a/src/ui/new_lobby.c
+++ b/src/ui/new_lobby.c
@@ -198,7 +198,7 @@ handle_id_drawing_area_draw(GtkWidget* drawing_area,
198 const guint w = handle->qr->width; 198 const guint w = handle->qr->width;
199 const guint w2 = w + m * 2; 199 const guint w2 = w + m * 2;
200 200
201 guchar pixels [w2 * w2 * 3]; 201 guchar *pixels = (guchar*) g_malloc(sizeof(guchar) * w2 * w2 * 3);
202 202
203 guint x, y, z; 203 guint x, y, z;
204 for (y = 0; y < w2; y++) 204 for (y = 0; y < w2; y++)
@@ -263,10 +263,11 @@ handle_id_drawing_area_draw(GtkWidget* drawing_area,
263 g_object_unref(scaled); 263 g_object_unref(scaled);
264 g_object_unref(image); 264 g_object_unref(image);
265 265
266 g_free(pixels);
267
266 return FALSE; 268 return FALSE;
267} 269}
268 270
269
270void 271void
271ui_new_lobby_dialog_init(MESSENGER_Application *app, 272ui_new_lobby_dialog_init(MESSENGER_Application *app,
272 UI_NEW_LOBBY_Handle *handle) 273 UI_NEW_LOBBY_Handle *handle)
@@ -386,7 +387,6 @@ ui_new_lobby_dialog_init(MESSENGER_Application *app,
386 ); 387 );
387} 388}
388 389
389
390void 390void
391ui_new_lobby_dialog_cleanup(UI_NEW_LOBBY_Handle *handle) 391ui_new_lobby_dialog_cleanup(UI_NEW_LOBBY_Handle *handle)
392{ 392{
diff --git a/src/ui/new_platform.c b/src/ui/new_platform.c
index 8611432..5eea8d5 100644
--- a/src/ui/new_platform.c
+++ b/src/ui/new_platform.c
@@ -173,4 +173,6 @@ void
173ui_new_platform_dialog_cleanup(UI_NEW_PLATFORM_Handle *handle) 173ui_new_platform_dialog_cleanup(UI_NEW_PLATFORM_Handle *handle)
174{ 174{
175 g_object_unref(handle->builder); 175 g_object_unref(handle->builder);
176
177 memset(handle, 0, sizeof(*handle));
176} 178}
diff --git a/src/ui/send_file.c b/src/ui/send_file.c
index 991e8ce..b2e6bb0 100644
--- a/src/ui/send_file.c
+++ b/src/ui/send_file.c
@@ -378,4 +378,6 @@ ui_send_file_dialog_cleanup(UI_SEND_FILE_Handle *handle)
378 ); 378 );
379 379
380 g_object_unref(handle->builder); 380 g_object_unref(handle->builder);
381
382 memset(handle, 0, sizeof(*handle));
381} 383}
diff --git a/src/ui/settings.c b/src/ui/settings.c
index 6863968..7583941 100644
--- a/src/ui/settings.c
+++ b/src/ui/settings.c
@@ -1,6 +1,6 @@
1/* 1/*
2 This file is part of GNUnet. 2 This file is part of GNUnet.
3 Copyright (C) 2021 GNUnet e.V. 3 Copyright (C) 2021--2022 GNUnet e.V.
4 4
5 GNUnet is free software: you can redistribute it and/or modify it 5 GNUnet is free software: you can redistribute it and/or modify it
6 under the terms of the GNU Affero General Public License as published 6 under the terms of the GNU Affero General Public License as published
@@ -62,4 +62,6 @@ void
62ui_settings_dialog_cleanup(UI_SETTINGS_Handle *handle) 62ui_settings_dialog_cleanup(UI_SETTINGS_Handle *handle)
63{ 63{
64 g_object_unref(handle->builder); 64 g_object_unref(handle->builder);
65
66 memset(handle, 0, sizeof(*handle));
65} 67}