[gjs: 16/22] toggle: Initialize private variables on construction




commit 51dd60a101dd34cef10edfcc2df6519320cde02a
Author: Marco Trevisan (TreviƱo) <mail 3v1n0 net>
Date:   Sat Apr 3 04:45:59 2021 +0200

    toggle: Initialize private variables on construction

 gi/toggle.h | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gi/toggle.h b/gi/toggle.h
index 38ad88f6..9c9ab2db 100644
--- a/gi/toggle.h
+++ b/gi/toggle.h
@@ -42,8 +42,8 @@ private:
     std::deque<Item> q;
     std::atomic_bool m_shutdown = ATOMIC_VAR_INIT(false);
 
-    unsigned m_idle_id;
-    Handler m_toggle_handler;
+    unsigned m_idle_id = 0;
+    Handler m_toggle_handler = nullptr;
     std::atomic<GObject*> m_toggling_gobj = nullptr;
 
     /* No-op unless GJS_VERBOSE_ENABLE_LIFECYCLE is defined to 1. */


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]