[epiphany] clear-data-view: Check if cancellable is NULL before clearing it
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany] clear-data-view: Check if cancellable is NULL before clearing it
- Date: Thu, 2 Jul 2020 15:33:17 +0000 (UTC)
commit c5d72c387d801588dd109093ca2885c8916b233a
Author: Yetizone <andreii lisita gmail com>
Date: Wed Jul 1 11:32:44 2020 +0300
clear-data-view: Check if cancellable is NULL before clearing it
Needed to prevent crashing in case clear_data_view_dispose() is called multiple times
src/preferences/clear-data-view.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
---
diff --git a/src/preferences/clear-data-view.c b/src/preferences/clear-data-view.c
index 45ec63d1c..47dabd685 100644
--- a/src/preferences/clear-data-view.c
+++ b/src/preferences/clear-data-view.c
@@ -338,8 +338,10 @@ clear_data_view_dispose (GObject *object)
{
ClearDataView *clear_data_view = (ClearDataView *)object;
- g_cancellable_cancel (clear_data_view->cancellable);
- g_clear_object (&clear_data_view->cancellable);
+ if (clear_data_view->cancellable) {
+ g_cancellable_cancel (clear_data_view->cancellable);
+ g_clear_object (&clear_data_view->cancellable);
+ }
G_OBJECT_CLASS (clear_data_view_parent_class)->dispose (object);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]