diff --git a/src/libnm-platform/nmp-route-manager.c b/src/libnm-platform/nmp-route-manager.c index a4cbf2e8bb..6828bb57f9 100644 --- a/src/libnm-platform/nmp-route-manager.c +++ b/src/libnm-platform/nmp-route-manager.c @@ -788,12 +788,13 @@ nmp_route_manager_new(NMPlatform *platform) return self; } -void +NMPRouteManager * nmp_route_manager_ref(NMPRouteManager *self) { - g_return_if_fail(NMP_IS_ROUTE_MANAGER(self)); + g_return_val_if_fail(NMP_IS_ROUTE_MANAGER(self), NULL); self->ref_count++; + return self; } void diff --git a/src/libnm-platform/nmp-route-manager.h b/src/libnm-platform/nmp-route-manager.h index 17af8ee0c5..23e4c2d341 100644 --- a/src/libnm-platform/nmp-route-manager.h +++ b/src/libnm-platform/nmp-route-manager.h @@ -13,8 +13,8 @@ typedef struct _NMPRouteManager NMPRouteManager; NMPRouteManager *nmp_route_manager_new(NMPlatform *platform); -void nmp_route_manager_ref(NMPRouteManager *self); -void nmp_route_manager_unref(NMPRouteManager *self); +NMPRouteManager *nmp_route_manager_ref(NMPRouteManager *self); +void nmp_route_manager_unref(NMPRouteManager *self); #define nm_auto_unref_route_manager nm_auto(_nmp_route_manager_unref) NM_AUTO_DEFINE_FCN0(NMPRouteManager *, _nmp_route_manager_unref, nmp_route_manager_unref);