From: Walter Doekes Date: Sat, 9 Apr 2022 17:48:22 +0000 (+0200) Subject: fix warning when not really starting netradiant X-Git-Url: https://de.git.xonotic.org/?p=xonotic%2Fnetradiant.git;a=commitdiff_plain;h=ae44289b622d865703391443ceec59497208680d 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. --- 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 ); + } } /*!