[libchamplain] Reset the sql statement before bind_text also for stmt_select



commit 6f6b2297d2c7d712003b5d5fcf4bd921daf597df
Author: JiÅ?í Techet <techet gmail com>
Date:   Thu May 13 01:24:04 2010 +0200

    Reset the sql statement before bind_text also for stmt_select
    
    Signed-off-by: JiÅ?í Techet <techet gmail com>

 champlain/champlain-file-cache.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/champlain/champlain-file-cache.c b/champlain/champlain-file-cache.c
index d671b79..88c4720 100644
--- a/champlain/champlain-file-cache.c
+++ b/champlain/champlain-file-cache.c
@@ -654,6 +654,7 @@ tile_loaded_cb (ClutterTexture *texture,
       int sql_rc = SQLITE_OK;
 
       /* Retrieve etag */
+      sqlite3_reset (priv->stmt_select);
       sql_rc = sqlite3_bind_text (priv->stmt_select, 1, filename, -1, SQLITE_STATIC);
       if (sql_rc == SQLITE_ERROR)
         {
@@ -700,7 +701,6 @@ load_next:
     champlain_tile_set_state (tile, CHAMPLAIN_STATE_DONE);
 
 cleanup:
-  sqlite3_reset (priv->stmt_select);
   g_free (filename);
   g_object_unref (map_source);
 }
@@ -883,8 +883,8 @@ on_tile_filled (ChamplainTileCache *tile_cache,
   filename = get_filename (file_cache, tile);
 
   DEBUG ("popularity of %s", filename);
-  sqlite3_reset (priv->stmt_update);
 
+  sqlite3_reset (priv->stmt_update);
   sql_rc = sqlite3_bind_text (priv->stmt_update, 1, filename, -1, SQLITE_STATIC);
   if (sql_rc != SQLITE_OK)
     {



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]