[gnome-color-manager/gnome-3-12] Fix several critical warnings when using gcm-viewer
- From: Richard Hughes <rhughes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-color-manager/gnome-3-12] Fix several critical warnings when using gcm-viewer
- Date: Thu, 3 Apr 2014 22:07:44 +0000 (UTC)
commit 8c4284ca2da27a63d5e6e3be34c04069126255df
Author: Richard Hughes <richard hughsie com>
Date: Wed Apr 2 12:47:14 2014 +0200
Fix several critical warnings when using gcm-viewer
src/gcm-cell-renderer-color.c | 6 +++++-
src/gcm-cell-renderer-profile-text.c | 3 +--
src/gcm-trc-widget.c | 2 +-
src/gcm-viewer.c | 4 ++--
4 files changed, 9 insertions(+), 6 deletions(-)
---
diff --git a/src/gcm-cell-renderer-color.c b/src/gcm-cell-renderer-color.c
index 8839002..8c43ea8 100644
--- a/src/gcm-cell-renderer-color.c
+++ b/src/gcm-cell-renderer-color.c
@@ -114,11 +114,15 @@ static void
gcm_cell_renderer_color_set_property (GObject *object, guint param_id,
const GValue *value, GParamSpec *pspec)
{
+ CdColorLab *tmp;
GcmCellRendererColor *renderer = GCM_CELL_RENDERER_COLOR (object);
switch (param_id) {
case PROP_COLOR:
- cd_color_lab_copy (g_value_get_boxed (value), renderer->color);
+ tmp = g_value_get_boxed (value);
+ if (tmp == NULL)
+ return;
+ cd_color_lab_copy (tmp, renderer->color);
gcm_cell_renderer_set_color (renderer);
break;
case PROP_PROFILE:
diff --git a/src/gcm-cell-renderer-profile-text.c b/src/gcm-cell-renderer-profile-text.c
index ce664c8..f67cbb7 100644
--- a/src/gcm-cell-renderer-profile-text.c
+++ b/src/gcm-cell-renderer-profile-text.c
@@ -68,8 +68,7 @@ gcm_cell_renderer_get_profile_text (CdProfile *profile)
if (profile == NULL) {
/* TRANSLATORS: this is when there is no profile for the device */
- string = g_string_new (_("No profile"));
- goto out;
+ return g_string_new (_("No profile"));
}
/* add profile description */
diff --git a/src/gcm-trc-widget.c b/src/gcm-trc-widget.c
index f521b4e..1b6954b 100644
--- a/src/gcm-trc-widget.c
+++ b/src/gcm-trc-widget.c
@@ -160,7 +160,7 @@ gcm_trc_widget_finalize (GObject *object)
g_object_unref (trc->priv->layout);
if (trc->priv->data != NULL)
- g_object_unref (trc->priv->data);
+ g_ptr_array_unref (trc->priv->data);
G_OBJECT_CLASS (gcm_trc_widget_parent_class)->finalize (object);
}
diff --git a/src/gcm-viewer.c b/src/gcm-viewer.c
index 3097ff0..0a161e5 100644
--- a/src/gcm-viewer.c
+++ b/src/gcm-viewer.c
@@ -1313,7 +1313,7 @@ gcm_viewer_client_profile_removed_cb (CdClient *client,
GcmViewerPrivate *viewer)
{
g_debug ("%s removed, rescanning",
- cd_profile_get_id (profile));
+ cd_profile_get_object_path (profile));
gcm_viewer_update_profile_list (viewer);
}
@@ -1786,7 +1786,7 @@ main (int argc, char **argv)
gchar *filename = NULL;
GcmViewerPrivate *viewer;
GOptionContext *context;
- guint xid;
+ guint xid = 0;
int status = 0;
gboolean ret;
GError *error = NULL;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]