diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2011-01-09 03:39:08 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2011-01-09 03:39:08 +0000 |
commit | 2e9c610931b4e0a6bab25b1fe5dbd0def45ee126 (patch) | |
tree | 1c740e32afcfc6570b5e87d179c12854ea4f686c /sca-cpp/trunk/components/sqldb/pgsql.hpp | |
parent | d2a4018d6c354a75e45800f90f45d09469bc4db5 (diff) |
Fix memory leak in Python runtime integration. Reduce memory consumption of debug trace functions. Add trace points to help track the lifecycle of some of the runtime context objects.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1056880 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to '')
-rw-r--r-- | sca-cpp/trunk/components/sqldb/pgsql.hpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/sca-cpp/trunk/components/sqldb/pgsql.hpp b/sca-cpp/trunk/components/sqldb/pgsql.hpp index f4da8db220..7dca38b086 100644 --- a/sca-cpp/trunk/components/sqldb/pgsql.hpp +++ b/sca-cpp/trunk/components/sqldb/pgsql.hpp @@ -55,9 +55,12 @@ const string pgfailure(PGresult* r, PGconn* conn) { class PGSql { public: PGSql() : owner(false) { + debug("pgsql::pgsql"); } PGSql(const string& conninfo, const string& table) : owner(true), conn(NULL), conninfo(conninfo), table(table) { + debug(conninfo, "pgsql::pgsql::conninfo"); + debug(table, "pgsql::pgsql::table"); conn = PQconnectdb(c_str(conninfo)); if (PQstatus(conn) != CONNECTION_OK) { mkfailure<bool>(string("Could not connect to postgresql database: ") + PQerrorMessage(conn)); @@ -67,9 +70,11 @@ public: } PGSql(const PGSql& c) : owner(false), conn(c.conn), conninfo(c.conninfo), table(c.table) { + debug("pgsql::pgsql::copy"); } ~PGSql() { + debug("pgsql::~pgsql"); if (!owner) return; if (conn == NULL) |