diff options
-rw-r--r-- | plugins/filebrowser/pluma-file-browser-widget.c | 3 | ||||
-rw-r--r-- | pluma/pluma-document-loader.c | 6 | ||||
-rw-r--r-- | pluma/pluma-document-saver.c | 6 | ||||
-rw-r--r-- | pluma/pluma-plugins-engine.c | 9 |
4 files changed, 6 insertions, 18 deletions
diff --git a/plugins/filebrowser/pluma-file-browser-widget.c b/plugins/filebrowser/pluma-file-browser-widget.c index 7d41e74c..5056999b 100644 --- a/plugins/filebrowser/pluma-file-browser-widget.c +++ b/plugins/filebrowser/pluma-file-browser-widget.c @@ -2459,8 +2459,7 @@ directory_open (PlumaFileBrowserWidget *obj, PLUMA_FILE_BROWSER_ERROR_OPEN_DIRECTORY, error->message); - g_error_free (error); - error = NULL; + g_clear_error (&error); } } diff --git a/pluma/pluma-document-loader.c b/pluma/pluma-document-loader.c index 62bc9b29..421c6ed4 100644 --- a/pluma/pluma-document-loader.c +++ b/pluma/pluma-document-loader.c @@ -223,11 +223,7 @@ pluma_document_loader_dispose (GObject *object) priv->gfile = NULL; } - if (priv->error != NULL) - { - g_error_free (priv->error); - priv->error = NULL; - } + g_clear_error (&priv->error); if (priv->info != NULL) { diff --git a/pluma/pluma-document-saver.c b/pluma/pluma-document-saver.c index 61ed6666..997e91db 100644 --- a/pluma/pluma-document-saver.c +++ b/pluma/pluma-document-saver.c @@ -206,11 +206,7 @@ pluma_document_saver_dispose (GObject *object) priv->gfile = NULL; } - if (priv->error != NULL) - { - g_error_free (priv->error); - priv->error = NULL; - } + g_clear_error (&priv->error); if (priv->stream != NULL) { diff --git a/pluma/pluma-plugins-engine.c b/pluma/pluma-plugins-engine.c index 8d4f5a5e..741c77bf 100644 --- a/pluma/pluma-plugins-engine.c +++ b/pluma/pluma-plugins-engine.c @@ -71,16 +71,14 @@ pluma_plugins_engine_init (PlumaPluginsEngine *engine) "Peas", "1.0", 0, &error)) { g_warning ("Could not load Peas repository: %s", error->message); - g_error_free (error); - error = NULL; + g_clear_error (&error); } if (!g_irepository_require (g_irepository_get_default (), "PeasGtk", "1.0", 0, &error)) { g_warning ("Could not load PeasGtk repository: %s", error->message); - g_error_free (error); - error = NULL; + g_clear_error (&error); } private_path = g_build_filename (LIBDIR, "girepository-1.0", NULL); @@ -89,8 +87,7 @@ pluma_plugins_engine_init (PlumaPluginsEngine *engine) private_path, "Pluma", "1.0", 0, &error)) { g_warning ("Could not load Pluma repository: %s", error->message); - g_error_free (error); - error = NULL; + g_clear_error (&error); } g_free (private_path); |