---
 src/emulator.c |   17 +++++++++++++++++
 1 files changed, 17 insertions(+), 0 deletions(-)

diff --git a/src/emulator.c b/src/emulator.c
index e7c7d41..2c40898 100644
--- a/src/emulator.c
+++ b/src/emulator.c
@@ -52,6 +52,8 @@ struct ofono_emulator {
        gboolean clip;
        gboolean ccwa;
        int pns_id;
+       void *data;
+       ofono_destroy_func destroy;
 };
 
 struct indicator {
@@ -954,6 +956,9 @@ static void emulator_remove(struct ofono_atom *atom)
 
        DBG("atom: %p", atom);
 
+       if (em->destroy)
+               em->destroy(em->data);
+
        g_free(em);
 }
 
@@ -997,6 +1002,18 @@ void ofono_emulator_remove(struct ofono_emulator *em)
        __ofono_atom_free(em->atom);
 }
 
+void ofono_emulator_set_data(struct ofono_emulator *em, void *data,
+                                               ofono_destroy_func destroy)
+{
+       em->data = data;
+       em->destroy = destroy;
+}
+
+void *ofono_emulator_get_data(struct ofono_emulator *em)
+{
+       return em->data;
+}
+
 void ofono_emulator_send_final(struct ofono_emulator *em,
                                const struct ofono_error *final)
 {
-- 
1.7.1

_______________________________________________
ofono mailing list
[email protected]
http://lists.ofono.org/listinfo/ofono

Reply via email to