Merge lp:~jpakkane/libgrip/stale-geis-fix into lp:libgrip

Proposed by Jussi Pakkanen on 2011-09-19
Status: Merged
Merged at revision: 61
Proposed branch: lp:~jpakkane/libgrip/stale-geis-fix
Merge into: lp:libgrip
Diff against target: 16 lines (+4/-1)
1 file modified
src/gripgesturemanager.c (+4/-1)
To merge this branch: bzr merge lp:~jpakkane/libgrip/stale-geis-fix
Reviewer Review Type Date Requested Status
Stephen M. Webb (community) 2011-09-19 Approve on 2011-09-19
Review via email:

Description of the change

Assign pointer to zero after deinitialisation.

To post a comment you must log in.
Stephen M. Webb (bregma) wrote :

I don't see how NULLing a pointer will fix this problem: it will just segfault at a different location due to a NULL pointer dereference.

It appears the problem is that io_callback() is getting invoked after geis_finish() has been called, because the g_io channel is getting flushed. Since we don't care what's in the g_io channel, I would think the best solution is ti set the second argument to g_io_channel_shutdown() to FALSE.

lp:~jpakkane/libgrip/stale-geis-fix updated on 2011-09-19
62. By Jussi Pakkanen on 2011-09-19

Drop pending events when shutting down IO channel.

63. By Jussi Pakkanen on 2011-09-19

Explicitly unref the iochannel object so it is deallocated.

Jussi Pakkanen (jpakkane) wrote :


GLib's documentation says that _shutdown() does not free the object itself. That only happens when the ref count drops to zero. So I added an explicit unref call.

Stephen M. Webb (bregma) wrote :

I think that should do the trick.

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-02 10:40:35 +0000
3+++ src/gripgesturemanager.c 2011-09-19 13:52:27 +0000
4@@ -966,8 +966,11 @@
5 }
7 g_list_free (reg->bindings);
8- g_io_channel_shutdown (reg->iochannel, TRUE, NULL);
9+ g_io_channel_shutdown (reg->iochannel, FALSE, NULL);
10 geis_finish (reg->instance);
11+ g_io_channel_unref(reg->iochannel);
12+ reg->instance = NULL;
13+ reg->iochannel = NULL;
14 }
16 static void


People subscribed via source and target branches