[PATCH] devices/wwan: Stop PPP manager in deactivate_cleanup()



When ModemManager exits, pppd is not killed due to nm_exported_object not
unexported (ppp_manager refcount = 2).
Call to nm_ppp_manager_stop_sync() allows to correctly clean ppp_manager
before calling g_clear_object(), as this is done in nm-device-ethernet.c and
nm-device-adsl.c.

https://bugzilla.gnome.org/show_bug.cgi?id=796108
---
 src/devices/wwan/nm-modem.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/devices/wwan/nm-modem.c b/src/devices/wwan/nm-modem.c
index 010a2b6..3e902fa 100644
--- a/src/devices/wwan/nm-modem.c
+++ b/src/devices/wwan/nm-modem.c
@@ -1095,7 +1095,10 @@ deactivate_cleanup (NMModem *self, NMDevice *device)
 
        priv->in_bytes = priv->out_bytes = 0;
 
-       g_clear_object (&priv->ppp_manager);
+       if (priv->ppp_manager) {
+               nm_ppp_manager_stop_sync (priv->ppp_manager);
+               g_clear_object (&priv->ppp_manager);
+       }
 
        if (device) {
                g_return_if_fail (NM_IS_DEVICE (device));
-- 
2.7.4



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]