예제 #1
0
static void sql_free_async(void *_async_command) {
  async_sqlite3_command *async_command =
      (async_sqlite3_command *) _async_command;
  driver_free(async_command->dataset);

  async_command->driver_data->async_handle = 0;

  free_ptr_list(async_command->ptrs, &driver_free_fun);

  free_ptr_list(async_command->binaries, &driver_free_binary_fun);

  if ((async_command->type == t_stmt) &&
      async_command->finalize_statement_on_free &&
      async_command->statement) {
    sqlite3_finalize(async_command->statement);
    async_command->statement = NULL;
  } else if (async_command->type == t_script) {
    driver_free(async_command->script);
  }
  driver_free(async_command);
}
예제 #2
0
static void
clean_up_mem()
{
#ifdef DEBUG
	if (mem_list.size() != 0)
		printf("mem_list leaks %ld objects\n", mem_list.size());

	for (mem_iter_t i = mem_list.begin(); i != mem_list.end(); ) {
		printf("%p allocated at %s:%ld\n", i->ptr, i->file, i->line);	
		free(i->ptr);
		free(i->file);
		i = mem_list.erase(i);
	}
#else
	free_ptr_list(mem_list);
#endif
}