Merge lp:~bregma/libgrip/lp-830640 into lp:libgrip

Proposed by Stephen M. Webb on 2011-09-22
Status: Merged
Merged at revision: 62
Proposed branch: lp:~bregma/libgrip/lp-830640
Merge into: lp:libgrip
Diff against target: 54 lines (+11/-10)
1 file modified
src/gripgesturemanager.c (+11/-10)
To merge this branch: bzr merge lp:~bregma/libgrip/lp-830640
Reviewer Review Type Date Requested Status
Chase Douglas (community) 2011-09-22 Approve on 2011-09-22
Review via email: mp+76643@code.launchpad.net

Description of the change

Removed the GIO channel from the main lop on shutdown to prevent stray events from being posted.

To post a comment you must log in.
Chase Douglas (chasedouglas) wrote :

Looks right to me

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/gripgesturemanager.c'
2--- src/gripgesturemanager.c 2011-09-19 13:45:46 +0000
3+++ src/gripgesturemanager.c 2011-09-22 20:00:29 +0000
4@@ -87,6 +87,7 @@
5 GPtrArray *gesture_list;
6 GeisInstance instance;
7 GIOChannel *iochannel;
8+ int iochannel_id;
9 };
10
11 struct _GripRegistrationRequest
12@@ -966,9 +967,13 @@
13 }
14
15 g_list_free (reg->bindings);
16+
17 g_io_channel_shutdown (reg->iochannel, FALSE, NULL);
18+ g_source_remove (reg->iochannel_id);
19+ g_io_channel_unref (reg->iochannel);
20+
21 geis_finish (reg->instance);
22- g_io_channel_unref(reg->iochannel);
23+
24 reg->instance = NULL;
25 reg->iochannel = NULL;
26 }
27@@ -1052,7 +1057,6 @@
28 {
29 GripGestureRegistration *reg;
30 GeisInstance instance;
31- GIOChannel *iochannel;
32 gint fd = -1;
33 GeisXcbWinInfo xcb_win_info = {
34 .display_name = NULL,
35@@ -1095,14 +1099,11 @@
36 G_CALLBACK (window_destroyed_cb),
37 manager);
38
39- iochannel = g_io_channel_unix_new (fd);
40- g_io_add_watch (iochannel,
41- G_IO_IN,
42- io_callback,
43- reg);
44-
45- reg->iochannel = iochannel;
46-
47+ reg->iochannel = g_io_channel_unix_new (fd);
48+ reg->iochannel_id = g_io_add_watch (reg->iochannel,
49+ G_IO_IN,
50+ io_callback,
51+ reg);
52 reg->gesture_list = g_ptr_array_new ();
53
54 return reg;

Subscribers

People subscribed via source and target branches