Merge lp:~ghugesss/xpad/xpad into lp:xpad

Proposed by Sagar Ghuge on 2014-07-23
Status: Merged
Approved by: Arthur Borsboom on 2014-07-31
Approved revision: no longer in the source branch.
Merged at revision: 699
Proposed branch: lp:~ghugesss/xpad/xpad
Merge into: lp:xpad
Diff against target: 56 lines (+4/-8)
3 files modified
ChangeLog (+1/-0)
src/xpad-app.c (+3/-7)
src/xpad-pad-group.c (+0/-1)
To merge this branch: bzr merge lp:~ghugesss/xpad/xpad
Reviewer Review Type Date Requested Status
Arthur Borsboom quick code test 2014-07-23 Approve on 2014-07-31
Review via email: mp+227890@code.launchpad.net

Description of the change

Fix seg fault :

We are trying to unref this : gtk_icon_theme_get_default (void) but doc says that we should not ref it and unref it.

checked with object ref count every thing looks fine. No other ref remains.

To post a comment you must log in.
Arthur Borsboom (arthurborsboom) wrote :

Hi Sagar,

Most of the offered code looks good and might indeed solve the problem.
What is the reason you take out this piece of code?

group->priv->pads = NULL;

Sagar Ghuge (ghugesss) wrote :

Hi,

If I am not wrong then pads are actually our toplevel widgets and we are destroying it. so if we destroy the toplevel widget according to documentation those will gets finalized automatically so I don't think so that we need to set pads to NULL. That's why I removed the code. And if I introduce that line again then it will give me the seg fault. ( as it is already finalized and still we were trying to set it to NULL ) that's why may be.

lp:~ghugesss/xpad/xpad updated on 2014-07-30
696. By Launchpad Translations on behalf of xpad-team on 2014-07-28

Launchpad automatic translations update.

697. By Launchpad Translations on behalf of xpad-team on 2014-07-29

Launchpad automatic translations update.

698. By Launchpad Translations on behalf of xpad-team on 2014-07-30

Launchpad automatic translations update.

Arthur Borsboom (arthurborsboom) wrote :

Code looks good.

I did a quick test: run xpad, check preferences, start/stop, etc.
I didn't do a refcount check. We will do this before releasing.

Good job!

review: Approve (quick code test)
lp:~ghugesss/xpad/xpad updated on 2014-07-31
699. By Arthur Borsboom on 2014-07-31

* Fix: Seg Fault - Seg fault on closing the xpad (#1333727)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'ChangeLog'
2--- ChangeLog 2014-07-20 16:36:07 +0000
3+++ ChangeLog 2014-07-23 11:11:38 +0000
4@@ -1,5 +1,6 @@
5 Version 4.4
6 * Fix: Preferences - redesign of preferences box to make sure it fits on small screens (#1333636)
7+* Fix: Seg Fault - Seg fault on closing the xpad (#1333727)
8
9 Version 4.3
10 * New: Systray - ability to hide the tray icon (#890334)
11
12=== modified file 'src/xpad-app.c'
13--- src/xpad-app.c 2014-06-19 19:33:52 +0000
14+++ src/xpad-app.c 2014-07-23 11:11:38 +0000
15@@ -245,15 +245,13 @@
16 void
17 xpad_app_quit (void)
18 {
19- /* Give GTK the signal to clean the rest and quit the application. */
20- gtk_main_quit ();
21-
22 /* Free the memory used by the pads belonging to this group */
23 xpad_pad_group_destroy_pads (pad_group);
24
25 /* Free the memory used by group. */
26 if (G_IS_OBJECT (pad_group))
27 g_object_unref (pad_group);
28+ pad_group = NULL;
29
30 /* Free the memory used by the tray icon and its menu. */
31 xpad_tray_dispose (settings);
32@@ -263,10 +261,8 @@
33 g_object_unref (settings);
34 settings = NULL; /* This is needed due to the asynchronous finalizing process. */
35
36- /* Free the theme reference. Unfortunately GTK3 leaves about 600 objects behind. */
37- if (G_IS_OBJECT (gtk_icon_theme_get_default ()))
38- g_object_unref (gtk_icon_theme_get_default ());
39-
40+ /* Give GTK the signal to clean the rest and quit the application. */
41+ gtk_main_quit ();
42 }
43
44 static gboolean
45
46=== modified file 'src/xpad-pad-group.c'
47--- src/xpad-pad-group.c 2014-06-20 10:23:13 +0000
48+++ src/xpad-pad-group.c 2014-07-23 11:11:38 +0000
49@@ -124,7 +124,6 @@
50 xpad_pad_group_save_unsaved_all(group);
51
52 g_slist_foreach (group->priv->pads, (GFunc) gtk_widget_destroy, NULL);
53- group->priv->pads = NULL;
54 }
55
56 guint

Subscribers

People subscribed via source and target branches