gnokii-commit
[Top][All Lists]
Advanced

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

[SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-26


From: Pawel Kot
Subject: [SCM] libgnokii and core programs branch, master, updated. rel_0_6_29-26-gf271afe
Date: Sun, 27 Jun 2010 10:49:38 +0000

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "libgnokii and core programs".

The branch, master has been updated
       via  f271afeaa42864335bf2e9c5fb91878b62718097 (commit)
      from  ef2a213062c6677dd0c5e067971b6a10c96fc704 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/gnokii.git/commit/?id=f271afeaa42864335bf2e9c5fb91878b62718097


commit f271afeaa42864335bf2e9c5fb91878b62718097
Author: Pawel Kot <address@hidden>
Date:   Sun Jun 27 12:48:25 2010 +0200

    Free the cached file lists upon exit in nk6510.

diff --git a/ChangeLog b/ChangeLog
index d9d62ce..5bd3e80 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -9,6 +9,8 @@
                                                         (Paweł Kot)
     o parse call notification frames on Series 40 (tested on 3rd
       Ed.); closes https://savannah.nongnu.org/bugs/?20895
+                                                    (Daniele Forsi)
+    o free the cached file lists up on exist            (Paweł Kot)
  * nk7110 driver updates
     o fix reading SMS from AR and TE                (Daniele Forsi)
  * win32 updates
diff --git a/common/phones/nk6510.c b/common/phones/nk6510.c
index 27bb8d4..a6aa049 100644
--- a/common/phones/nk6510.c
+++ b/common/phones/nk6510.c
@@ -73,6 +73,8 @@ typedef struct {
        char *path;
 } path2mt_t;
 
+static struct map *file_cache_map = NULL;
+
 static path2mt_t s40_30_mt_mappings[] = {
        { GN_MT_IN, "C:\\predefmessages\\1\\" },
        { GN_MT_OUS, "C:\\predefmessages\\2\\" },
@@ -189,6 +191,7 @@ static void inc_filecount(gn_file_list *fl)
 /* Functions prototypes */
 static gn_error NK6510_Functions(gn_operation op, gn_data *data, struct 
gn_statemachine *state);
 static gn_error NK6510_Initialise(struct gn_statemachine *state);
+static gn_error NK6510_Terminate(gn_data *data, struct gn_statemachine *state);
 
 static gn_error NK6510_GetModel(gn_data *data, struct gn_statemachine *state);
 static gn_error NK6510_GetRevision(gn_data *data, struct gn_statemachine 
*state);
@@ -391,8 +394,7 @@ static gn_error NK6510_Functions(gn_operation op, gn_data 
*data, struct gn_state
        case GN_OP_Init:
                return NK6510_Initialise(state);
        case GN_OP_Terminate:
-               FREE(DRVINSTANCE(state));
-               return pgen_terminate(data, state);
+               return NK6510_Terminate(data, state);
        case GN_OP_GetModel:
                return NK6510_GetModel(data, state);
        case GN_OP_GetRevision:
@@ -681,6 +683,13 @@ static gn_error NK6510_Initialise(struct gn_statemachine 
*state)
        return GN_ERR_NONE;
 }
 
+static gn_error NK6510_Terminate(gn_data *data, struct gn_statemachine *state)
+{
+       FREE(DRVINSTANCE(state));
+       map_free(&file_cache_map);
+       return pgen_terminate(data, state);
+}
+
 /**********************/
 /* IDENTIFY FUNCTIONS */
 /**********************/
@@ -2203,7 +2212,6 @@ static gn_error NK6510_GetFileListCache(gn_data *data, 
struct gn_statemachine *s
 {
        gn_error error = GN_ERR_NONE;
        gn_file_list *fl;
-       static struct map *map = NULL;
        int count = NK6510_FILE_CACHE_TIMEOUT;
 
        dprintf("Trying to retrieve filelist of %s from cache\n", 
data->file_list->path);
@@ -2213,14 +2221,14 @@ static gn_error NK6510_GetFileListCache(gn_data *data, 
struct gn_statemachine *s
         * use proper timeout: the more files are in the folder the longer
         * it takes to get the file list.
         */
-       fl = map_get(&map, data->file_list->path, 0);
+       fl = map_get(&file_cache_map, data->file_list->path, 0);
        /*
         * A fl->file_count value of zero would give a timeout of zero which
         * means "no timeout", so keep the default value in that case.
         */
        if (fl && fl->file_count)
                count *= fl->file_count;
-       fl = map_get(&map, data->file_list->path, count);
+       fl = map_get(&file_cache_map, data->file_list->path, count);
        if (!fl) {
                dprintf("Cache empty or expired\n");
                error = NK6510_GetFileList(data, state);
@@ -2228,7 +2236,7 @@ static gn_error NK6510_GetFileListCache(gn_data *data, 
struct gn_statemachine *s
                        char *path = strdup(data->file_list->path);
                        fl = calloc(1, sizeof(gn_file_list));
                        memcpy(fl, data->file_list, sizeof(gn_file_list));
-                       map_add(&map, path, fl);
+                       map_add(&file_cache_map, path, fl);
                }
        } else {
                memcpy(data->file_list, fl, sizeof(gn_file_list));

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog              |    2 ++
 common/phones/nk6510.c |   20 ++++++++++++++------
 2 files changed, 16 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
libgnokii and core programs



reply via email to

[Prev in Thread] Current Thread [Next in Thread]