[gitg] Fix race condition in the line parser



commit 96557d3f9f74d5b56c5ebfc5e5f5e6a6626f8e6c
Author: Garrett Regier <garrettregier gmail com>
Date:   Fri Jul 22 17:13:13 2011 -0700

    Fix race condition in the line parser

 libgitg/gitg-line-parser.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
---
diff --git a/libgitg/gitg-line-parser.c b/libgitg/gitg-line-parser.c
index 889aeda..e3fee83 100644
--- a/libgitg/gitg-line-parser.c
+++ b/libgitg/gitg-line-parser.c
@@ -71,7 +71,7 @@ async_data_new (GitgLineParser *parser,
 	AsyncData *data;
 
 	data = g_slice_new (AsyncData);
-	data->parser = parser;
+	data->parser = g_object_ref (parser);
 	data->stream = stream;
 	data->cancellable = g_object_ref (cancellable);
 
@@ -81,6 +81,7 @@ async_data_new (GitgLineParser *parser,
 static void
 async_data_free (AsyncData *data)
 {
+	g_object_unref (data->parser);
 	g_object_unref (data->cancellable);
 	g_slice_free (AsyncData, data);
 }



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