[gnome-color-manager] trivial: ref the profile to avoid a crash in the prefs



commit 0f94218b284dc9d107ce2ad660a33d30a2e53890
Author: Richard Hughes <richard hughsie com>
Date:   Wed May 26 16:13:04 2010 +0100

    trivial: ref the profile to avoid a crash in the prefs

 src/gcm-device-xrandr.c |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/gcm-device-xrandr.c b/src/gcm-device-xrandr.c
index 1ca5558..4d52811 100644
--- a/src/gcm-device-xrandr.c
+++ b/src/gcm-device-xrandr.c
@@ -480,6 +480,8 @@ gcm_device_xrandr_apply (GcmDevice *device, GError **error)
 	/* if not saved, try to find default profile */
 	saved = gcm_device_get_saved (device);
 	profile = gcm_device_get_default_profile (device);
+	if (profile != NULL)
+		g_object_ref (profile);
 	if (!saved && profile == NULL) {
 		filename_systemwide = g_strdup_printf ("%s/%s.icc", GCM_SYSTEM_PROFILES_DIR, id);
 		ret = g_file_test (filename_systemwide, G_FILE_TEST_EXISTS);



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]