summaryrefslogtreecommitdiffstats
path: root/editor/editor_log.h
diff options
context:
space:
mode:
authorRémi Verschelde <rverschelde@gmail.com>2022-04-04 15:06:57 +0200
committerRémi Verschelde <rverschelde@gmail.com>2022-04-04 19:49:50 +0200
commitf8ab79e68af20e18e1d868b64d6dfd0c429bc554 (patch)
treea9d2df2e2df939c189135b1c36a01e06b37b80b2 /editor/editor_log.h
parent53317bbe146dd19a919685df8d846c55568daba1 (diff)
downloadredot-engine-f8ab79e68af20e18e1d868b64d6dfd0c429bc554.tar.gz
Zero initialize all pointer class and struct members
This prevents the pitfall of UB when checking if they have been assigned something valid by comparing to nullptr.
Diffstat (limited to 'editor/editor_log.h')
-rw-r--r--editor/editor_log.h16
1 files changed, 8 insertions, 8 deletions
diff --git a/editor/editor_log.h b/editor/editor_log.h
index e66b732ffe..267ad406d4 100644
--- a/editor/editor_log.h
+++ b/editor/editor_log.h
@@ -117,23 +117,23 @@ private:
// Maps MessageTypes to LogFilters for convenient access and storage (don't need 1 member per filter).
Map<MessageType, LogFilter *> type_filter_map;
- RichTextLabel *log;
+ RichTextLabel *log = nullptr;
- Button *clear_button;
- Button *copy_button;
+ Button *clear_button = nullptr;
+ Button *copy_button = nullptr;
- Button *collapse_button;
+ Button *collapse_button = nullptr;
bool collapse = false;
- Button *show_search_button;
- LineEdit *search_box;
+ Button *show_search_button = nullptr;
+ LineEdit *search_box = nullptr;
// Reference to the "Output" button on the toolbar so we can update it's icon when
// Warnings or Errors are encounetered.
- Button *tool_button;
+ Button *tool_button = nullptr;
bool is_loading_state = false; // Used to disable saving requests while loading (some signals from buttons will try trigger a save, which happens during loading).
- Timer *save_state_timer;
+ Timer *save_state_timer = nullptr;
static void _error_handler(void *p_self, const char *p_func, const char *p_file, int p_line, const char *p_error, const char *p_errorexp, bool p_editor_notify, ErrorHandlerType p_type);