dovecot-2.2: lib-sql: Debugging help - Added assert before clear...
dovecot at dovecot.org
dovecot at dovecot.org
Wed Sep 2 14:20:09 UTC 2015
details: http://hg.dovecot.org/dovecot-2.2/rev/0770ab82703d
changeset: 19057:0770ab82703d
user: Timo Sirainen <tss at iki.fi>
date: Wed Sep 02 17:19:08 2015 +0300
description:
lib-sql: Debugging help - Added assert before clearing sql_result.callback.
If result is unrefed too many times, this still allows accessing the
callback from a debugger.
diffstat:
src/lib-sql/driver-cassandra.c | 3 ++-
src/lib-sql/driver-pgsql.c | 3 ++-
2 files changed, 4 insertions(+), 2 deletions(-)
diffs (36 lines):
diff -r 97ff15e9a7fd -r 0770ab82703d src/lib-sql/driver-cassandra.c
--- a/src/lib-sql/driver-cassandra.c Wed Sep 02 17:16:41 2015 +0300
+++ b/src/lib-sql/driver-cassandra.c Wed Sep 02 17:19:08 2015 +0300
@@ -470,12 +470,13 @@
result->callback(&result->api, result->context);
} T_END;
result->api.callback = FALSE;
- result->callback = NULL;
free_result = db->sync_result != &result->api;
if (db->ioloop != NULL)
io_loop_stop(db->ioloop);
+ i_assert(!free_result || result->api.refcount > 0);
+ result->callback = NULL;
if (free_result)
sql_result_unref(&result->api);
}
diff -r 97ff15e9a7fd -r 0770ab82703d src/lib-sql/driver-pgsql.c
--- a/src/lib-sql/driver-pgsql.c Wed Sep 02 17:16:41 2015 +0300
+++ b/src/lib-sql/driver-pgsql.c Wed Sep 02 17:19:08 2015 +0300
@@ -387,12 +387,13 @@
result->callback(&result->api, result->context);
} T_END;
result->api.callback = FALSE;
- result->callback = NULL;
free_result = db->sync_result != &result->api;
if (db->ioloop != NULL)
io_loop_stop(db->ioloop);
+ i_assert(!free_result || result->api.refcount > 0);
+ result->callback = NULL;
if (free_result)
sql_result_unref(&result->api);
}
More information about the dovecot-cvs
mailing list