OFono: Calling the callback in a wrong order
authorIscaro <iscaro@profusion.mobi>
Mon, 24 Sep 2012 14:31:06 +0000 (11:31 -0300)
committerGustavo Sverzut Barbieri <barbieri@profusion.mobi>
Tue, 25 Sep 2012 19:13:41 +0000 (16:13 -0300)
utils/ofono.c

index 961a847..5f6466d 100644 (file)
@@ -1513,11 +1513,11 @@ static void _msg_add(OFono_Modem *m, const char *path, DBusMessageIter *prop)
 
        if (sms->pending_send) {
                OFono_Sent_SMS_Cb_Context *ctx = sms->pending_send;
-               if (ctx->cb)
-                       ctx->cb((void *)ctx->data, OFONO_ERROR_NONE, sms);
                sms->destination = ctx->destination;
                sms->message = ctx->message;
                sms->timestamp = time(NULL);
+               if (ctx->cb)
+                       ctx->cb((void *)ctx->data, OFONO_ERROR_NONE, sms);
                free(ctx);
                sms->pending_send = NULL;
        }