Commit 6597016
ensure wpe input-xkb context returns NULL on error
The `wpe_input_xkb_context_get_default` call manages a singleton WPE
input (XKB) context for an implementer to easily fetch. However, if
the underlying request of building an XKB context (`xkb_context_new`)
fails, a singleton will be created with a managed `NULL` context. The
only safe way for an implementer to utilize other WPE input calls is to
call `wpe_input_xkb_context_get_context` and ensure the returned context
is not `NULL` (a practice not really used). And even if there was a way
to recover the environment to ensure `xkb_context_new` can return a
value context, there is no way to rebuild the singleton.
To prevent such a state, this commit tweaks the
`wpe_input_xkb_context_get_default` call to only store/return a WPE
input (XKB) context if the underlying XKB context could be created. This
way, implements can know immediately when attempting to prepare WPE
input if the environment does not supported input at this time.
Signed-off-by: James Knight <[email protected]>1 parent cfa9699 commit 6597016
1 file changed
+5
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
49 | | - | |
50 | | - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
51 | 54 | | |
52 | 55 | | |
53 | 56 | | |
| |||
0 commit comments