diff options
author | Richard Hughes <richard@hughsie.com> | 2015-06-08 14:48:20 +0100 |
---|---|---|
committer | Richard Hughes <richard@hughsie.com> | 2015-06-08 14:48:20 +0100 |
commit | 30e8c28c80dd8534c1a2f3f533b383aaa46bbe7f (patch) | |
tree | 7bab2af7f7a1eed41267fa472d18d6ae3957abc5 | |
parent | 3071f32f6008bf3b07a076ed1e412e8f44efe64b (diff) | |
download | gusb-30e8c28c80dd8534c1a2f3f533b383aaa46bbe7f.tar.gz |
trivial: Fix up style of new method to match the codebase
-rw-r--r-- | gusb/gusb-context.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/gusb/gusb-context.c b/gusb/gusb-context.c index ab28508..5c7dfe2 100644 --- a/gusb/gusb-context.c +++ b/gusb/gusb-context.c @@ -417,6 +417,7 @@ GMainContext * g_usb_context_get_main_context (GUsbContext *context) { GUsbContextPrivate *priv = context->priv; + g_return_val_if_fail (G_USB_IS_CONTEXT (context), NULL); return priv->main_ctx; } @@ -430,9 +431,13 @@ g_usb_context_get_main_context (GUsbContext *context) * Since: 0.2.5 **/ void -g_usb_context_set_main_context (GUsbContext *context, GMainContext *main_ctx) +g_usb_context_set_main_context (GUsbContext *context, + GMainContext *main_ctx) { GUsbContextPrivate *priv = context->priv; + + g_return_if_fail (G_USB_IS_CONTEXT (context)); + if (main_ctx != priv->main_ctx){ g_main_context_unref (priv->main_ctx); priv->main_ctx = g_main_context_ref (main_ctx); |