mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2025-11-24 06:59:50 -05:00
Handle marshalling NULL objects.
This commit is contained in:
parent
0555d8e6fc
commit
4a35fc2563
1 changed files with 2 additions and 2 deletions
|
|
@ -252,7 +252,7 @@ wl_connection_vmarshal(struct wl_connection *connection,
|
||||||
case 'o':
|
case 'o':
|
||||||
case 'n':
|
case 'n':
|
||||||
object = va_arg(ap, struct wl_object *);
|
object = va_arg(ap, struct wl_object *);
|
||||||
*p++ = object->id;
|
*p++ = object ? object->id : 0;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
assert(0);
|
assert(0);
|
||||||
|
|
@ -331,7 +331,7 @@ wl_connection_demarshal(struct wl_connection *connection,
|
||||||
case 'o':
|
case 'o':
|
||||||
types[i] = &ffi_type_pointer;
|
types[i] = &ffi_type_pointer;
|
||||||
object = wl_hash_lookup(objects, *p);
|
object = wl_hash_lookup(objects, *p);
|
||||||
if (object == NULL)
|
if (object == NULL && *p != 0)
|
||||||
printf("unknown object (%d)\n", *p);
|
printf("unknown object (%d)\n", *p);
|
||||||
values[i].object = object;
|
values[i].object = object;
|
||||||
p++;
|
p++;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue