* [Qemu-devel] [PATCH] gtk: Don't crash if -nodefaults
@ 2014-11-21 1:59 Fam Zheng
2014-11-21 7:43 ` Gerd Hoffmann
0 siblings, 1 reply; 2+ messages in thread
From: Fam Zheng @ 2014-11-21 1:59 UTC (permalink / raw)
To: qemu-devel; +Cc: Gerd Hoffmann
This fixes a crash by just skipping the vte resize hack if cur is NULL.
Reproducer:
qemu-system-x86_64 -nodefaults
Signed-off-by: Fam Zheng <famz@redhat.com>
---
ui/gtk.c | 16 +++++++++-------
1 file changed, 9 insertions(+), 7 deletions(-)
diff --git a/ui/gtk.c b/ui/gtk.c
index 38bf463..29e09a7 100644
--- a/ui/gtk.c
+++ b/ui/gtk.c
@@ -1910,15 +1910,17 @@ void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hover)
#ifdef VTE_RESIZE_HACK
{
VirtualConsole *cur = gd_vc_find_current(s);
- int i;
-
- for (i = 0; i < s->nb_vcs; i++) {
- VirtualConsole *vc = &s->vc[i];
- if (vc && vc->type == GD_VC_VTE && vc != cur) {
- gtk_widget_hide(vc->vte.terminal);
+ if (cur) {
+ int i;
+
+ for (i = 0; i < s->nb_vcs; i++) {
+ VirtualConsole *vc = &s->vc[i];
+ if (vc && vc->type == GD_VC_VTE && vc != cur) {
+ gtk_widget_hide(vc->vte.terminal);
+ }
}
+ gd_update_windowsize(cur);
}
- gd_update_windowsize(cur);
}
#endif
--
1.9.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH] gtk: Don't crash if -nodefaults
2014-11-21 1:59 [Qemu-devel] [PATCH] gtk: Don't crash if -nodefaults Fam Zheng
@ 2014-11-21 7:43 ` Gerd Hoffmann
0 siblings, 0 replies; 2+ messages in thread
From: Gerd Hoffmann @ 2014-11-21 7:43 UTC (permalink / raw)
To: Fam Zheng; +Cc: qemu-devel
On Fr, 2014-11-21 at 09:59 +0800, Fam Zheng wrote:
> This fixes a crash by just skipping the vte resize hack if cur is
> NULL.
Picked up for 2.2.
thanks,
Gerd
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-11-21 7:44 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-21 1:59 [Qemu-devel] [PATCH] gtk: Don't crash if -nodefaults Fam Zheng
2014-11-21 7:43 ` Gerd Hoffmann
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).