[brasero] Fix a memleak
- From: Philippe Rouquier <philippr src gnome org>
- To: svn-commits-list gnome org
- Subject: [brasero] Fix a memleak
- Date: Tue, 14 Jul 2009 18:20:03 +0000 (UTC)
commit 8219227292bb17156feced3199f795f8da8e8647
Author: Philippe Rouquier <bonfire-app wanadoo fr>
Date: Tue Jul 14 16:51:11 2009 +0200
Fix a memleak
libbrasero-burn/brasero-caps-session.c | 2 +-
libbrasero-media/brasero-drive.c | 13 ++++++++++++-
2 files changed, 13 insertions(+), 2 deletions(-)
---
diff --git a/libbrasero-burn/brasero-caps-session.c b/libbrasero-burn/brasero-caps-session.c
index 2bfaebc..3896f6d 100644
--- a/libbrasero-burn/brasero-caps-session.c
+++ b/libbrasero-burn/brasero-caps-session.c
@@ -982,9 +982,9 @@ BraseroImageFormat
brasero_burn_session_get_default_output_format (BraseroBurnSession *session)
{
BraseroBurnCaps *self;
- BraseroTrackType output;
BraseroBurnResult result;
BraseroTrackType source = { BRASERO_TRACK_TYPE_NONE, { 0, }};
+ BraseroTrackType output = { BRASERO_TRACK_TYPE_NONE, { 0, }};
self = brasero_burn_caps_get_default ();
diff --git a/libbrasero-media/brasero-drive.c b/libbrasero-media/brasero-drive.c
index 9978f4f..d801253 100644
--- a/libbrasero-media/brasero-drive.c
+++ b/libbrasero-media/brasero-drive.c
@@ -68,6 +68,8 @@ struct _BraseroDrivePrivate
BraseroMedium *medium;
BraseroDriveCaps caps;
+ gchar *udi;
+
gchar *path;
gchar *block_path;
@@ -494,7 +496,11 @@ brasero_drive_get_udi (BraseroDrive *drive)
if (!priv->gdrive)
return NULL;
- return g_drive_get_identifier (priv->gdrive, G_VOLUME_IDENTIFIER_KIND_HAL_UDI);
+ if (priv->udi)
+ return priv->udi;
+
+ priv->udi = g_drive_get_identifier (priv->gdrive, G_VOLUME_IDENTIFIER_KIND_HAL_UDI);
+ return priv->udi;
}
/**
@@ -999,6 +1005,11 @@ brasero_drive_finalize (GObject *object)
priv = BRASERO_DRIVE_PRIVATE (object);
+ if (priv->udi) {
+ g_free (priv->udi);
+ priv->udi = NULL;
+ }
+
if (priv->probe) {
priv->probe_cancelled = TRUE;
g_thread_join (priv->probe);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]