Merge lp:~a-j-buxton/lightdm/vt-double-unref-fix into lp:lightdm

Proposed by Alistair Buxton
Status: Merged
Approved by: Robert Ancell
Approved revision: 1847
Merged at revision: 1848
Proposed branch: lp:~a-j-buxton/lightdm/vt-double-unref-fix
Merge into: lp:lightdm
Diff against target: 20 lines (+2/-2)
1 file modified
src/x-server-local.c (+2/-2)
To merge this branch: bzr merge lp:~a-j-buxton/lightdm/vt-double-unref-fix
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Robert Ancell Approve
Review via email: mp+197247@code.launchpad.net

Commit message

Fix the possible double unref'ing of VTs.

Description of the change

Fix the possible double unref'ing of VTs. eg: Display 1 shuts down, unref'ing the VT. Display 2 starts, ref'ing the now-free VT. Then finalize() is called on display 1, which unref's the VT again, leaving it free for any future displays to claim, even though display 2 is still using it.

To post a comment you must log in.
Revision history for this message
Robert Ancell (robert-ancell) wrote :

Thanks Alistair!

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/x-server-local.c'
2--- src/x-server-local.c 2013-10-14 23:22:46 +0000
3+++ src/x-server-local.c 2013-11-29 17:18:27 +0000
4@@ -178,7 +178,7 @@
5 x_server_local_set_vt (XServerLocal *server, gint vt)
6 {
7 g_return_if_fail (server != NULL);
8- if (server->priv->vt > 0)
9+ if (server->priv->have_vt_ref)
10 vt_unref (server->priv->vt);
11 server->priv->have_vt_ref = FALSE;
12 server->priv->vt = vt;
13@@ -586,7 +586,7 @@
14 g_free (self->priv->mir_id);
15 g_free (self->priv->mir_socket);
16 g_free (self->priv->authority_file);
17- if (self->priv->vt > 0)
18+ if (self->priv->have_vt_ref)
19 vt_unref (self->priv->vt);
20 g_free (self->priv->background);
21

Subscribers

People subscribed via source and target branches