diff options
author | 2009-12-23 12:25:34 -0500 | |
---|---|---|
committer | 2009-12-23 12:25:34 -0500 | |
commit | 1466bbaa78fe224dd227fb50b2a6a21bcd10a74b (patch) | |
tree | 4316dc52416e5099c11db0f6214699bdb950019e /src/c/urweb.c | |
parent | ff717ba5c13390b4c5412ee968505193f0f7daba (diff) |
Stop skipping Especialization of generated functions; fix Compiler.parseUrp; expose uw_really_write(); allow more NULL arguments to uw_register_transactional()
Diffstat (limited to 'src/c/urweb.c')
-rw-r--r-- | src/c/urweb.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/c/urweb.c b/src/c/urweb.c index f852ddb8..ef159333 100644 --- a/src/c/urweb.c +++ b/src/c/urweb.c @@ -2773,11 +2773,13 @@ void uw_commit(uw_context ctx) { for (i = 0; i < ctx->used_transactionals; ++i) if (ctx->transactionals[i].rollback != NULL) - ctx->transactionals[i].commit(ctx->transactionals[i].data); + if (ctx->transactionals[i].commit) + ctx->transactionals[i].commit(ctx->transactionals[i].data); for (i = 0; i < ctx->used_transactionals; ++i) if (ctx->transactionals[i].rollback == NULL) - ctx->transactionals[i].commit(ctx->transactionals[i].data); + if (ctx->transactionals[i].commit) + ctx->transactionals[i].commit(ctx->transactionals[i].data); if (uw_db_commit(ctx)) uw_error(ctx, FATAL, "Error running SQL COMMIT"); @@ -2795,7 +2797,8 @@ void uw_commit(uw_context ctx) { release_client(ctx->client); for (i = 0; i < ctx->used_transactionals; ++i) - ctx->transactionals[i].free(ctx->transactionals[i].data); + if (ctx->transactionals[i].free) + ctx->transactionals[i].free(ctx->transactionals[i].data); // Splice script data into appropriate part of page if (ctx->returning_indirectly || ctx->script_header[0] == 0) { @@ -2855,9 +2858,6 @@ int uw_rollback(uw_context ctx) { void uw_register_transactional(uw_context ctx, void *data, uw_callback commit, uw_callback rollback, uw_callback free) { - if (commit == NULL) - uw_error(ctx, FATAL, "uw_register_transactional: NULL commit callback"); - if (ctx->used_transactionals >= ctx->n_transactionals) { ctx->transactionals = realloc(ctx->transactionals, ctx->used_transactionals+1); ++ctx->n_transactionals; |