lkml.org 
[lkml]   [2012]   [Aug]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] perf ui/gtk: Ensure not to call gtk_main_quit() twice
From
On Fri, Aug 17, 2012 at 7:56 PM, Namhyung Kim <namhyung@kernel.org> wrote:
> Currently the gtk_main_quit() is called twice when perf exits so the
> following warning is emitted:
>
> [penberg@tux perf]$ ./perf report --gtk
> ^Cperf: Interrupt
>
> (perf:4048): Gtk-CRITICAL **: IA__gtk_main_quit: assertion `main_loops != NULL' failed
>
> Fix it by not to call it unnecessarily.
>
> Reported-by: Pekka Enberg <penberg@kernel.org>
> Signed-off-by: Namhyung Kim <namhyung@kernel.org>
> ---
> tools/perf/ui/gtk/setup.c | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/tools/perf/ui/gtk/setup.c b/tools/perf/ui/gtk/setup.c
> index ad40b3626fdb..ec1ee26b485a 100644
> --- a/tools/perf/ui/gtk/setup.c
> +++ b/tools/perf/ui/gtk/setup.c
> @@ -13,6 +13,8 @@ int perf_gtk__init(void)
>
> void perf_gtk__exit(bool wait_for_ok __used)
> {
> + if (!perf_gtk__is_active_context(pgctx))
> + return;
> perf_error__unregister(&perf_gtk_eops);
> gtk_main_quit();
> }

Wouldn't it be nicer to rearrange the callers so that perf_gtk__exit()
is not called twice?


\
 
 \ /
  Last update: 2012-08-18 10:21    [W:0.137 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site