Commit c871725b authored by Chris T's avatar Chris T

Clean up the plugin some more.

parent 7d8e5225
......@@ -131,7 +131,6 @@ static void mmsd_plugin_connect (void);
static void mmsd_plugin_disconnect (void);
static void free_device (PurMmDevice *device);
static void bearer_handler(mms_bool_t active, void *user_data);
static void unset_context (void);
static int set_context (void);
static void cb_mm_manager_new (GDBusConnection *connection, GAsyncResult *res, gpointer user_data);
static void mm_appeared_cb (GDBusConnection *connection, const gchar *name, const gchar *name_owner, gpointer user_data);
......@@ -683,7 +682,6 @@ static void bearer_handler(mms_bool_t active, void *user_data)
gint32 response;
/* Check for any errors within the context */
unset_context();
response = set_context();
if (response != MMSD_MM_MODEM_CONTEXT_ACTIVE) {
mms_error("ModemManagerPlugin(): Set MMSC: %s, Set Proxy: %s, Set MMS APN: %s", modem->message_center, modem->MMS_proxy, modem->mms_apn);
......@@ -731,6 +729,10 @@ static int set_context (void) {
gboolean interface_disconnected;
mms_error("ModemManagerPlugin(): Setting Context...");
if (modem->context_active) {
g_free(modem->context_interface);
g_free(modem->context_path);
}
modem->context_active = FALSE;
interface_disconnected = FALSE;
mms_service_set_mmsc(modem->service, modem->message_center);
......@@ -799,13 +801,6 @@ static int set_context (void) {
}
static void unset_context (void) {
if (modem->context_active) {
g_free(modem->context_interface);
g_free(modem->context_path);
}
modem->context_active = FALSE;
}
static void mmsd_plugin_connect (void) {
if (modem->plugin_registered == FALSE) {
......
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