[epiphany/mcatanzaro/more-leaks: 2/3] find-toolbar: simplify dispose
- From: Michael Catanzaro <mcatanzaro src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [epiphany/mcatanzaro/more-leaks: 2/3] find-toolbar: simplify dispose
- Date: Fri, 16 Sep 2022 19:10:10 +0000 (UTC)
commit 7c44712904ae35a641738a61fbebdd4587c821d8
Author: Michael Catanzaro <mcatanzaro redhat com>
Date: Fri Sep 16 14:00:27 2022 -0500
find-toolbar: simplify dispose
g_clear_handler_id() is good, and g_cancellable_cancel() is NULL-safe.
embed/ephy-find-toolbar.c | 17 ++++-------------
1 file changed, 4 insertions(+), 13 deletions(-)
---
diff --git a/embed/ephy-find-toolbar.c b/embed/ephy-find-toolbar.c
index 33eb9a114..e46a4311f 100644
--- a/embed/ephy-find-toolbar.c
+++ b/embed/ephy-find-toolbar.c
@@ -412,20 +412,11 @@ ephy_find_toolbar_dispose (GObject *object)
{
EphyFindToolbar *toolbar = EPHY_FIND_TOOLBAR (object);
- if (toolbar->find_again_source_id != 0) {
- g_source_remove (toolbar->find_again_source_id);
- toolbar->find_again_source_id = 0;
- }
-
- if (toolbar->find_source_id != 0) {
- g_source_remove (toolbar->find_source_id);
- toolbar->find_source_id = 0;
- }
+ g_clear_handle_id (&toolbar->find_again_source_id, g_source_remove);
+ g_clear_handle_id (&toolbar->find_source_id, g_source_remove);
- if (toolbar->cancellable) {
- g_cancellable_cancel (toolbar->cancellable);
- g_clear_object (&toolbar->cancellable);
- }
+ g_cancellable_cancel (toolbar->cancellable);
+ g_clear_object (&toolbar->cancellable);
G_OBJECT_CLASS (ephy_find_toolbar_parent_class)->dispose (object);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]