Skip to content

Commit

Permalink
Memory cleanups.
Browse files Browse the repository at this point in the history
  • Loading branch information
mmichalek committed Nov 13, 2015
1 parent 7c6e4e2 commit 159db83
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
1 change: 0 additions & 1 deletion symmetric-client-clib/inc/db/sqlite/SqliteSqlTemplate.h
Expand Up @@ -33,7 +33,6 @@
typedef struct SymSqliteSqlTemplate {
SymSqlTemplate super;
sqlite3 *db;
void (*destroy)(struct SymSqliteSqlTemplate *this);
} SymSqliteSqlTemplate;

SymSqliteSqlTemplate * SymSqliteSqlTemplate_new(SymSqliteSqlTemplate *this, sqlite3 *db);
Expand Down
6 changes: 3 additions & 3 deletions symmetric-client-clib/src/db/platform/sqlite/SqlitePlatform.c
Expand Up @@ -48,11 +48,11 @@ SymSqliteSqlTemplate * SymSqlitePlatform_getSqlTemplate(SymSqlitePlatform *this)

void SymSqlitePlatform_destroy(SymDatabasePlatform *super) {
SymLog_info("Closing SQLite database");
// SymSqlitePlatform *this = (SymSqlitePlatform *) super;
SymSqlitePlatform *this = (SymSqlitePlatform *) super;
// sqlite3_close(this->db);
// this->sqlTemplate->destroy(this->sqlTemplate);
this->sqlTemplate->destroy(this->sqlTemplate);
// free(super->ddlReader);
// free(super);
free(this);
}

SymSqlitePlatform * SymSqlitePlatform_new(SymSqlitePlatform *this, SymProperties *properties) {
Expand Down
Expand Up @@ -207,6 +207,6 @@ SymSqliteSqlTemplate * SymSqliteSqlTemplate_new(SymSqliteSqlTemplate *this, sqli
super->queryWithUserData = (void *) &SymSqliteSqlTemplate_queryWithUserData;
super->update = (void *) &SymSqliteSqlTemplate_update;
super->startSqlTransaction = (void *) &SymSqliteSqlTemplate_startSqlTransaction;
this->destroy = (void *) &SymSqliteSqlTemplate_destroy;
super->destroy = (void *) &SymSqliteSqlTemplate_destroy;
return this;
}
2 changes: 2 additions & 0 deletions symmetric-client-clib/src/io/writer/DefaultDatabaseWriter.c
Expand Up @@ -280,6 +280,8 @@ void SymDefaultDatabaseWriter_endBatch(SymDefaultDatabaseWriter *this, SymBatch

void SymDefaultDatabaseWriter_close(SymDefaultDatabaseWriter *this) {
this->sqlTransaction->close(this->sqlTransaction);
this->sqlTransaction->destroy(this->sqlTransaction);
this->sqlTransaction = NULL;
}

void SymDefaultDatabaseWriter_destroy(SymDefaultDatabaseWriter *this) {
Expand Down

0 comments on commit 159db83

Please sign in to comment.