Changeset d8c3f54f2235ea1bd78457709267a09640ab4572

Show
Ignore:
Timestamp:
03/15/11 01:13:27 (4 years ago)
Author:
Theo Schlossnagle <jesus@omniti.com>
git-committer:
Theo Schlossnagle <jesus@omniti.com> 1300151607 +0000
git-parent:

[45f2d70c376339f71f20b78275ce5618a7be4910]

git-author:
Theo Schlossnagle <jesus@omniti.com> 1300151607 +0000
Message:

attempt to clear all these things asynchronously, and be carefult o not have them happen twice if we are unsuccessful

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • src/modules/postgres.c

    ra1d2509 rd8c3f54  
    197197 
    198198#define AVAIL_BAIL(str) do { \ 
     199  PGconn *conn_swap = ci->conn; \ 
     200  PGresult *result_swap = ci->result; \ 
     201  if(ci->result) { ci->result = NULL; PQclear(result_swap); } \ 
     202  if(ci->conn) { ci->conn = NULL; PQfinish(conn_swap); } \ 
    199203  ci->timed_out = 0; \ 
    200204  ci->error = strdup(str); \ 
     
    259263       default: 
    260264        AVAIL_BAIL(PQresultErrorMessage(ci->result)); 
     265      } 
     266      if(ci->result) { 
     267        PGresult *result_swap = ci->result; 
     268        ci->result = NULL; 
     269        PQclear(result_swap); 
     270      } 
     271      if(ci->conn) { 
     272        PGconn *conn_swap = ci->conn; 
     273        ci->conn = NULL; 
     274        PQfinish(conn_swap); 
    261275      } 
    262276      ci->timed_out = 0;