[gtranslator] Fix memory leak. Fixes bug #606216.
- From: Ignacio Casal Quinteiro <icq src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [gtranslator] Fix memory leak. Fixes bug #606216.
- Date: Tue, 19 Jan 2010 21:30:10 +0000 (UTC)
commit 2d9236d3146551bfc66e32f8ec7544614f227167
Author: Ignacio Casal Quinteiro <icq gnome org>
Date: Tue Jan 19 22:29:09 2010 +0100
Fix memory leak. Fixes bug #606216.
src/statusbar.c | 20 ++++++++++----------
1 files changed, 10 insertions(+), 10 deletions(-)
---
diff --git a/src/statusbar.c b/src/statusbar.c
index 1271653..616bb33 100644
--- a/src/statusbar.c
+++ b/src/statusbar.c
@@ -350,17 +350,17 @@ gtranslator_statusbar_update_progress_bar (GtranslatorStatusbar * statusbar,
*/
if (percentage > 0.0 || percentage < 1.0)
{
- /*
- * Set the progressbar status.
- */
- gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR
- (statusbar->priv->progress_bar),
+ gchar *percentage_str;
+
+ /* Set the progressbar status */
+ gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR (statusbar->priv->progress_bar),
percentage);
- gchar *aux = g_strconcat(g_strdup_printf("%.2f",percentage*100),"%",NULL);
- gtk_progress_bar_set_text (GTK_PROGRESS_BAR
- (statusbar->priv->progress_bar),
- aux);
- g_free(aux);
+
+ percentage_str = g_strdup_printf ("%.2f%%", percentage * 100);
+
+ gtk_progress_bar_set_text (GTK_PROGRESS_BAR (statusbar->priv->progress_bar),
+ percentage_str);
+ g_free (percentage_str);
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]