}
static void
-driver_cassandra_transaction_unref(struct cassandra_transaction_context *ctx)
+driver_cassandra_transaction_unref(struct cassandra_transaction_context **_ctx)
{
+ struct cassandra_transaction_context *ctx = *_ctx;
+
+ *_ctx = NULL;
i_assert(ctx->refcount > 0);
if (--ctx->refcount > 0)
return;
} else {
ctx->begin_succeeded = TRUE;
}
- driver_cassandra_transaction_unref(ctx);
+ driver_cassandra_transaction_unref(&ctx);
}
static void
ctx->callback(sql_result_get_error(result), ctx->context);
else
ctx->callback(NULL, ctx->context);
- driver_cassandra_transaction_unref(ctx);
+ driver_cassandra_transaction_unref(&ctx);
}
static void
ctx->failed = TRUE;
ctx->error = sql_result_get_error(result);
}
- driver_cassandra_transaction_unref(ctx);
+ driver_cassandra_transaction_unref(&ctx);
}
static void
if (ctx->failed || _ctx->head == NULL) {
callback(ctx->failed ? ctx->error : NULL, context);
- driver_cassandra_transaction_unref(ctx);
+ driver_cassandra_transaction_unref(&ctx);
} else if (_ctx->head->next == NULL) {
/* just a single query, send it */
sql_query(_ctx->db, _ctx->head->query,
i_assert(ctx->refcount == 1);
i_assert((*error_r != NULL) == ctx->failed);
- driver_cassandra_transaction_unref(ctx);
+ driver_cassandra_transaction_unref(&ctx);
return *error_r == NULL ? 0 : -1;
}
(struct cassandra_transaction_context *)_ctx;
i_assert(ctx->refcount == 1);
- driver_cassandra_transaction_unref(ctx);
+ driver_cassandra_transaction_unref(&ctx);
}
static void