From: erickson Date: Fri, 30 May 2008 02:10:23 +0000 (+0000) Subject: added check to make sure the db handle is not double-closed (causing segfaults) X-Git-Url: https://old-git.evergreen-ils.org/?a=commitdiff_plain;h=171bf6bbf48609cc4fc0379f578c7bb8dbbd88cf;p=Evergreen.git added check to make sure the db handle is not double-closed (causing segfaults) git-svn-id: svn://svn.open-ils.org/ILS/branches/rel_1_2@9733 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- diff --git a/Open-ILS/src/c-apps/oils_cstore.c b/Open-ILS/src/c-apps/oils_cstore.c index 592472185f..d66d5e3e3e 100644 --- a/Open-ILS/src/c-apps/oils_cstore.c +++ b/Open-ILS/src/c-apps/oils_cstore.c @@ -73,14 +73,15 @@ static int max_flesh_depth = 100; void osrfAppChildExit() { osrfLogDebug(OSRF_LOG_MARK, "Child is exiting, disconnecting from database..."); - if (writehandle) { - dbi_conn_query(writehandle, "ROLLBACK;"); - dbi_conn_close(writehandle); - writehandle = NULL; - } - - if (dbhandle) - dbi_conn_close(dbhandle); + int same = 0; + if (writehandle == dbhandle) same = 1; + if (writehandle) { + dbi_conn_query(writehandle, "ROLLBACK;"); + dbi_conn_close(writehandle); + writehandle = NULL; + } + if (dbhandle && !same) + dbi_conn_close(dbhandle); // XXX add cleanup of readHandles whenever that gets used