]> de.git.xonotic.org Git - xonotic/netradiant.git/commitdiff
fix warning when not really starting netradiant
authorWalter Doekes <walter+github@wjd.nu>
Sat, 9 Apr 2022 17:48:22 +0000 (19:48 +0200)
committerThomas Debesse <dev@illwieckz.net>
Sat, 18 Jun 2022 21:25:47 +0000 (23:25 +0200)
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

index 8c657fe7251fd80605ad5dd818227a235b5dffe5..a7739d4dce474fa6bdae9165e85422097c68d153 100644 (file)
@@ -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 );
+       }
 }
 
 /*!