From ae44289b622d865703391443ceec59497208680d Mon Sep 17 00:00:00 2001 From: Walter Doekes Date: Sat, 9 Apr 2022 19:48:22 +0200 Subject: [PATCH] fix warning when not really starting netradiant When doing netradiant --help, you would see: GLib-CRITICAL **: 19:22:11.618: g_string_free: assertion 'string != NULL' failed -- twice. This fixes it. --- radiant/preferences.h | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/radiant/preferences.h b/radiant/preferences.h index 8c657fe7..a7739d4d 100644 --- a/radiant/preferences.h +++ b/radiant/preferences.h @@ -357,9 +357,13 @@ public: ui::Widget m_notebook{ui::null}; -virtual ~PrefsDlg(){ - g_string_free( m_rc_path, true ); - g_string_free( m_inipath, true ); +virtual ~PrefsDlg() { + if (m_rc_path) { + g_string_free( m_rc_path, true ); + } + if (m_inipath) { + g_string_free( m_inipath, true ); + } } /*! -- 2.39.2