summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAleksander Morgado <aleksander@aleksander.es>2015-01-17 18:31:53 +0100
committerAleksander Morgado <aleksander@aleksander.es>2015-01-17 18:41:00 +0100
commit8a8104a9b5952a451b6346b6a188815f3ea0a508 (patch)
tree39b30c2ea9a5bb6ce07407ddda64e157ee6303de
parent732918344d9994f9e87ec77ff3a052710ec84629 (diff)
downloadlibmbim-8a8104a9b5952a451b6346b6a188815f3ea0a508.tar.gz
mbim-device: explictly maintain a reference to the MbimDevice in the transaction
We were already doing this as g_simple_async_result_new() was taking one itself, so this is just to make the code clearer and to ease next changes.
-rw-r--r--src/libmbim-glib/mbim-device.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libmbim-glib/mbim-device.c b/src/libmbim-glib/mbim-device.c
index 7f850a1..d373a1e 100644
--- a/src/libmbim-glib/mbim-device.c
+++ b/src/libmbim-glib/mbim-device.c
@@ -139,6 +139,7 @@ typedef struct {
} TransactionWaitContext;
typedef struct {
+ MbimDevice *self;
MbimMessage *fragments;
MbimMessageType type;
guint32 transaction_id;
@@ -162,6 +163,7 @@ transaction_new (MbimDevice *self,
tr = g_slice_new0 (Transaction);
tr->type = type;
tr->transaction_id = transaction_id;
+ tr->self = g_object_ref (self);
tr->result = g_simple_async_result_new (G_OBJECT (self),
callback,
user_data,
@@ -201,6 +203,7 @@ transaction_complete_and_free (Transaction *tr,
g_simple_async_result_complete_in_idle (tr->result);
g_object_unref (tr->result);
+ g_object_unref (tr->self);
g_slice_free (Transaction, tr);
}