mainwindow: call dispose on quit to close the daemon

Change-Id: I0a19ce6b3e96172859e823a9fc00397f591cf63f
Gitlab: #539
parent 7561fdca
......@@ -453,7 +453,7 @@ ring_client_shutdown(GApplication *app)
RingClient *self = RING_CLIENT(app);
RingClientPrivate *priv = RING_CLIENT_GET_PRIVATE(self);
g_debug("quitting");
gtk_widget_destroy(priv->win);
QObject::disconnect(priv->uam_updated);
......
......@@ -964,7 +964,9 @@ nm_client_cb(G_GNUC_UNUSED GObject *source_object, GAsyncResult *result, RingMa
void
CppImpl::init()
{
try {
lrc_->getAVModel().deactivateOldVideoModels();
} catch (...) {}
widgets->cancellable = g_cancellable_new();
#if USE_LIBNM
// monitor the network using libnm to notify the daemon about connectivity changes
......@@ -2215,21 +2217,21 @@ ring_main_window_dispose(GObject *object)
auto* self = RING_MAIN_WINDOW(object);
auto* priv = RING_MAIN_WINDOW_GET_PRIVATE(self);
if (priv->cpp) {
delete priv->cpp;
priv->cpp = nullptr;
delete priv->notifier;
priv->notifier = nullptr;
}
// cancel any pending cancellable operations
if (priv->cancellable) {
g_cancellable_cancel(priv->cancellable);
g_object_unref(priv->cancellable);
}
#if USE_LIBNM
// clear NetworkManager client if it was used
g_clear_object(&priv->nm_client);
#endif
G_OBJECT_CLASS(ring_main_window_parent_class)->dispose(object);
if (priv->general_settings_view) {
g_signal_handler_disconnect(priv->general_settings_view, priv->update_download_folder);
priv->update_download_folder = 0;
......@@ -2244,6 +2246,7 @@ ring_main_window_dispose(GObject *object)
g_signal_handler_disconnect(priv->notifier, priv->notif_decline_call);
priv->notif_decline_call = 0;
}
gtk_widget_destroy(priv->notifier);
}
static void
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment