Merge lp:~ted/libdbusmenu/lp757569 into lp:libdbusmenu/0.5

Proposed by Ted Gould
Status: Merged
Merged at revision: 336
Proposed branch: lp:~ted/libdbusmenu/lp757569
Merge into: lp:libdbusmenu/0.5
Diff against target: 13 lines (+2/-0)
1 file modified
libdbusmenu-glib/server.c (+2/-0)
To merge this branch: bzr merge lp:~ted/libdbusmenu/lp757569
Reviewer Review Type Date Requested Status
Andrea Cimitan (community) Approve
DBus Menu Team Pending
Review via email: mp+76799@code.launchpad.net

Description of the change

Add checkes to protect against a NULL priv? Eh, protected.

To post a comment you must log in.
Revision history for this message
Andrea Cimitan (cimi) wrote :

I was commenting the same, how it can be NULL?
My suggestion for the future is to store a pointer to the private structure in the DbusmenuServer struct, so you can use "server->priv" instead "DBUSMENU_SERVER_GET_PRIVATE(server)", and that should give better performance too.

Revision history for this message
Andrea Cimitan (cimi) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libdbusmenu-glib/server.c'
2--- libdbusmenu-glib/server.c 2011-06-28 16:40:16 +0000
3+++ libdbusmenu-glib/server.c 2011-09-23 19:57:30 +0000
4@@ -1194,7 +1194,9 @@
5 static void
6 bus_get_layout (DbusmenuServer * server, GVariant * params, GDBusMethodInvocation * invocation)
7 {
8+ g_return_if_fail(DBUSMENU_IS_SERVER(server));
9 DbusmenuServerPrivate * priv = DBUSMENU_SERVER_GET_PRIVATE(server);
10+ g_return_if_fail(priv != NULL);
11
12 /* Input */
13 gint32 parent;

Subscribers

People subscribed via source and target branches