UnQL

Check-in [9ee98afd91]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix memory leaks.
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 9ee98afd91d9013556a1f0af6a68e8920fd259f9
User & Date: drh 2011-06-25 00:13:08
Context
2011-06-27
12:19
Rework the shell command to make it useful as a test harness. check-in: e5de41b4de user: drh tags: trunk
2011-06-25
00:13
Fix memory leaks. check-in: 9ee98afd91 user: drh tags: trunk
00:07
Very simply queries working. check-in: 4eda880431 user: drh tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to src/conn.c.

65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
** means that any prepared statements must also be closed.
*/
int xjd1_close(xjd1 *pConn){
  if( pConn==0 ) return XJD1_OK;
  pConn->isDying = 1;
  if( pConn->nRef>0 ) return XJD1_OK;
  xjd1ContextUnref(pConn->pContext);
  sqlite3_free(pConn->db);
  xjd1StringClear(&pConn->errMsg);
  free(pConn);
  return XJD1_OK;
}

/*
** Report the most recent error.







|







65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
** means that any prepared statements must also be closed.
*/
int xjd1_close(xjd1 *pConn){
  if( pConn==0 ) return XJD1_OK;
  pConn->isDying = 1;
  if( pConn->nRef>0 ) return XJD1_OK;
  xjd1ContextUnref(pConn->pContext);
  sqlite3_close(pConn->db);
  xjd1StringClear(&pConn->errMsg);
  free(pConn);
  return XJD1_OK;
}

/*
** Report the most recent error.

Changes to src/shell.c.

168
169
170
171
172
173
174

175
176
177
      xjd1_stmt_delete(pStmt);
      zPrompt = "xjd1> ";
      nStmt = 0;
    }else{
      zPrompt = " ...> ";
    }
  }

  xjd1_close(pDb);
  return 0;
}







>



168
169
170
171
172
173
174
175
176
177
178
      xjd1_stmt_delete(pStmt);
      zPrompt = "xjd1> ";
      nStmt = 0;
    }else{
      zPrompt = " ...> ";
    }
  }
  free(zStmt);
  xjd1_close(pDb);
  return 0;
}