Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Dorota Czaplejewicz
gtk
Commits
31453164
Commit
31453164
authored
Mar 27, 2018
by
Lionel Landwerlin
Browse files
imwayland: destroy objects only if it matches our manager object
Should fix one of the crash from #129.
parent
a0f27346
Changes
1
Show whitespace changes
Inline
Side-by-side
modules/input/imwayland.c
View file @
31453164
...
...
@@ -35,6 +35,7 @@ struct _GtkIMContextWaylandGlobal
{
struct
wl_display
*
display
;
struct
wl_registry
*
registry
;
uint32_t
text_input_manager_wl_id
;
struct
gtk_text_input_manager
*
text_input_manager
;
struct
gtk_text_input
*
text_input
;
uint32_t
enter_serial
;
...
...
@@ -205,8 +206,9 @@ registry_handle_global (void *data,
if
(
strcmp
(
interface
,
"gtk_text_input_manager"
)
==
0
)
{
global
->
text_input_manager_wl_id
=
id
;
global
->
text_input_manager
=
wl_registry_bind
(
global
->
registry
,
id
,
wl_registry_bind
(
global
->
registry
,
global
->
text_input_manager_wl_
id
,
&
gtk_text_input_manager_interface
,
1
);
global
->
text_input
=
gtk_text_input_manager_get_text_input
(
global
->
text_input_manager
,
...
...
@@ -223,11 +225,11 @@ registry_handle_global_remove (void *data,
{
GtkIMContextWaylandGlobal
*
global
=
data
;
gtk_text_input_destroy
(
global
->
text_input
)
;
global
->
text_input
=
NULL
;
if
(
id
!=
global
->
text_input
_manager_wl_id
)
return
;
g
tk_text_input_manager_destroy
(
global
->
text_input_manager
);
global
->
text_input_manager
=
NULL
;
g
_clear_pointer
(
&
global
->
text_input
,
gtk_text_input_destroy
);
g_clear_pointer
(
&
global
->
text_input_manager
,
gtk_text_input_manager_destroy
)
;
}
static
const
struct
wl_registry_listener
registry_listener
=
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment