[gtksourceview/wip/search-start-signal: 5/6] SearchContext: fix object leak on regex search
- From: Sébastien Wilmet <swilmet src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/search-start-signal: 5/6] SearchContext: fix object leak on regex search
- Date: Wed, 10 Aug 2016 16:29:15 +0000 (UTC)
commit 13d0334fe25400de8885e3e14d5e2433b1877030
Author: Sébastien Wilmet <swilmet gnome org>
Date: Wed Aug 10 16:20:34 2016 +0200
SearchContext: fix object leak on regex search
gtksourceview/gtksourcesearchcontext.c | 9 +++++----
1 files changed, 5 insertions(+), 4 deletions(-)
---
diff --git a/gtksourceview/gtksourcesearchcontext.c b/gtksourceview/gtksourcesearchcontext.c
index bc48630..8535191 100644
--- a/gtksourceview/gtksourcesearchcontext.c
+++ b/gtksourceview/gtksourcesearchcontext.c
@@ -4008,8 +4008,7 @@ _gtk_source_search_context_update_highlight (GtkSourceSearchContext *search,
if (gtk_source_region_is_empty (region_to_highlight))
{
- g_clear_object (®ion_to_highlight);
- return;
+ goto out;
}
if (!synchronous)
@@ -4034,7 +4033,7 @@ _gtk_source_search_context_update_highlight (GtkSourceSearchContext *search,
®ion_start,
NULL))
{
- return;
+ goto out;
}
regex_search_scan_chunk (search, ®ion_start, end);
@@ -4042,6 +4041,8 @@ _gtk_source_search_context_update_highlight (GtkSourceSearchContext *search,
else
{
scan_all_region (search, region_to_highlight);
- g_clear_object (®ion_to_highlight);
}
+
+out:
+ g_clear_object (®ion_to_highlight);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]