* [PATCH] plugins: Fix allowed apn plugin exit
@ 2016-05-26 9:09 Nishanth V
2016-05-26 14:27 ` Denis Kenzior
0 siblings, 1 reply; 2+ messages in thread
From: Nishanth V @ 2016-05-26 9:09 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1518 bytes --]
---
plugins/allowed-apns.c | 15 +++++++++------
1 file changed, 9 insertions(+), 6 deletions(-)
diff --git a/plugins/allowed-apns.c b/plugins/allowed-apns.c
index 77ede86..fd68e35 100644
--- a/plugins/allowed-apns.c
+++ b/plugins/allowed-apns.c
@@ -32,7 +32,6 @@
#define OFONO_API_SUBJECT_TO_CHANGE
#include <ofono/plugin.h>
-#include <ofono/log.h>
#include <ofono/modem.h>
#include <ofono/sim.h>
#include <ofono/dbus.h>
@@ -43,6 +42,7 @@
#define ALLOWED_ACCESS_POINTS_INTERFACE "org.ofono.AllowedAccessPoints"
guint modemwatch_id;
+GSList *context_list;
struct allowed_apns_ctx {
guint simwatch_id;
@@ -54,8 +54,6 @@ struct allowed_apns_ctx {
DBusMessage *reply;
};
-GSList *context_list;
-
static void context_destroy(gpointer data)
{
struct allowed_apns_ctx *ctx = data;
@@ -71,8 +69,6 @@ static void context_destroy(gpointer data)
if (ctx->sim_context)
ofono_sim_context_free(ctx->sim_context);
- context_list = g_slist_remove(context_list, ctx);
-
g_free(ctx);
}
@@ -191,8 +187,15 @@ static void sim_watch(struct ofono_atom *atom,
struct allowed_apns_ctx *ctx = data;
if (cond == OFONO_ATOM_WATCH_CONDITION_UNREGISTERED) {
- if (ctx->sim_context)
+ if (ctx->simwatch_id) {
+ ofono_sim_remove_state_watch(ctx->sim, ctx->simwatch_id);
+ ctx->simwatch_id = 0;
+ }
+
+ if (ctx->sim_context) {
ofono_sim_context_free(ctx->sim_context);
+ ctx->sim_context = NULL;
+ }
return;
}
--
1.9.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-05-26 14:27 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-05-26 9:09 [PATCH] plugins: Fix allowed apn plugin exit Nishanth V
2016-05-26 14:27 ` Denis Kenzior
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.