mirror of https://github.com/xqemu/xqemu.git
gtk: Don't crash if -nodefaults
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> Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
parent
8a0f9b5263
commit
b310a2a609
2
ui/gtk.c
2
ui/gtk.c
|
@ -1909,6 +1909,7 @@ void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hover)
|
||||||
#ifdef VTE_RESIZE_HACK
|
#ifdef VTE_RESIZE_HACK
|
||||||
{
|
{
|
||||||
VirtualConsole *cur = gd_vc_find_current(s);
|
VirtualConsole *cur = gd_vc_find_current(s);
|
||||||
|
if (cur) {
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
for (i = 0; i < s->nb_vcs; i++) {
|
for (i = 0; i < s->nb_vcs; i++) {
|
||||||
|
@ -1919,6 +1920,7 @@ void gtk_display_init(DisplayState *ds, bool full_screen, bool grab_on_hover)
|
||||||
}
|
}
|
||||||
gd_update_windowsize(cur);
|
gd_update_windowsize(cur);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (full_screen) {
|
if (full_screen) {
|
||||||
|
|
Loading…
Reference in New Issue