Gitweb links:

...log 
http://git.netsurf-browser.org/netsurf.git/shortlog/8b0aec4bac4af7fe119227280ed15bf014f104c3
...commit 
http://git.netsurf-browser.org/netsurf.git/commit/8b0aec4bac4af7fe119227280ed15bf014f104c3
...tree 
http://git.netsurf-browser.org/netsurf.git/tree/8b0aec4bac4af7fe119227280ed15bf014f104c3

The branch, master has been updated
       via  8b0aec4bac4af7fe119227280ed15bf014f104c3 (commit)
       via  b03786920aa4aff2194d2e9c94e8301546897ae9 (commit)
       via  4065f1e0278d6d6d644bbf927b80125cf999a7bb (commit)
       via  6c2d97bf01c25f2af6fd41a741ca0f74230fd8f5 (commit)
      from  2d87e7ebeacb33836f8c959a00bb059ff3683963 (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 -----------------------------------------------------------------
commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=8b0aec4bac4af7fe119227280ed15bf014f104c3
commit 8b0aec4bac4af7fe119227280ed15bf014f104c3
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>

    Monkey: Clean up various leaked blocks
    
    Signed-off-by: Daniel Silverstone <[email protected]>

diff --git a/frontends/monkey/dispatch.c b/frontends/monkey/dispatch.c
index e60325c..08bd352 100644
--- a/frontends/monkey/dispatch.c
+++ b/frontends/monkey/dispatch.c
@@ -29,7 +29,7 @@
 
 typedef struct cmdhandler {
        struct cmdhandler *r_next, *r_prev;
-       const char *cmd;
+       char *cmd;
        handle_command_fn fn;
 } monkey_cmdhandler_t;
 
@@ -50,6 +50,17 @@ monkey_register_handler(const char *cmd, handle_command_fn 
fn)
 }
 
 void
+monkey_free_handlers(void)
+{
+       while (handler_ring != NULL) {
+               monkey_cmdhandler_t *handler = handler_ring;
+               RING_REMOVE(handler_ring, handler);
+               free(handler->cmd);
+               free(handler);
+       }
+}
+
+void
 monkey_process_command(void)
 {
        char buffer[PATH_MAX];
diff --git a/frontends/monkey/dispatch.h b/frontends/monkey/dispatch.h
index dc6e50a..11b1c02 100644
--- a/frontends/monkey/dispatch.h
+++ b/frontends/monkey/dispatch.h
@@ -25,4 +25,6 @@ nserror monkey_register_handler(const char *cmd, 
handle_command_fn fn);
 
 void monkey_process_command(void);
 
+void monkey_free_handlers(void);
+
 #endif /* NETSURF_MONKEY_DISPATCH_H */
diff --git a/frontends/monkey/main.c b/frontends/monkey/main.c
index 1e496cb..0b7efda 100644
--- a/frontends/monkey/main.c
+++ b/frontends/monkey/main.c
@@ -380,6 +380,12 @@ main(int argc, char **argv)
        urldb_load(nsoption_charp(url_file));
        urldb_load_cookies(nsoption_charp(cookie_file));
 
+       /* Free resource paths now we're done finding resources */
+       for (char **s = respaths; *s != NULL; s++) {
+               free(*s);
+       }
+       free(respaths);
+
        ret = monkey_register_handler("QUIT", quit_handler);
        if (ret != NSERROR_OK) {
                die("quit handler failed to register");
@@ -421,5 +427,8 @@ main(int argc, char **argv)
        /* finalise logging */
        nslog_finalise();
 
+       /* And free any monkey-specific bits */
+       monkey_free_handlers();
+
        return 0;
 }


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=b03786920aa4aff2194d2e9c94e8301546897ae9
commit b03786920aa4aff2194d2e9c94e8301546897ae9
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>

    hlcache_fini(): Deschedule cleanups on finalisation
    
    Signed-off-by: Daniel Silverstone <[email protected]>

diff --git a/content/hlcache.c b/content/hlcache.c
index aa782b2..ec011ec 100644
--- a/content/hlcache.c
+++ b/content/hlcache.c
@@ -660,6 +660,9 @@ void hlcache_finalise(void)
        NSLOG(netsurf, INFO, "hit/miss %d/%d", hlcache->hit_count,
              hlcache->miss_count);
 
+       /* De-schedule ourselves */
+       guit->misc->schedule(-1, hlcache_clean, NULL);
+
        free(hlcache);
        hlcache = NULL;
 


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=4065f1e0278d6d6d644bbf927b80125cf999a7bb
commit 4065f1e0278d6d6d644bbf927b80125cf999a7bb
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>

    netsurf_exit(): Release user-agent string on exit
    
    Signed-off-by: Daniel Silverstone <[email protected]>

diff --git a/desktop/netsurf.c b/desktop/netsurf.c
index 0928442..02080eb 100644
--- a/desktop/netsurf.c
+++ b/desktop/netsurf.c
@@ -33,6 +33,7 @@
 #include "utils/string.h"
 #include "utils/utf8.h"
 #include "utils/messages.h"
+#include "utils/useragent.h"
 #include "content/content_factory.h"
 #include "content/fetchers.h"
 #include "content/hlcache.h"
@@ -230,6 +231,8 @@ void netsurf_exit(void)
 
        NSLOG(netsurf, INFO, "Closing fetches");
        fetcher_quit();
+       /* Now the fetchers are done, our user-agent string can go */
+       free_user_agent_string();
 
        /* dump any remaining cache entries */
        image_cache_fini();


commitdiff 
http://git.netsurf-browser.org/netsurf.git/commit/?id=6c2d97bf01c25f2af6fd41a741ca0f74230fd8f5
commit 6c2d97bf01c25f2af6fd41a741ca0f74230fd8f5
Author: Daniel Silverstone <[email protected]>
Commit: Daniel Silverstone <[email protected]>

    useragent: Add a free_user_agent_string() function
    
    Signed-off-by: Daniel Silverstone <[email protected]>

diff --git a/utils/useragent.c b/utils/useragent.c
index b528dce..3d93a97 100644
--- a/utils/useragent.c
+++ b/utils/useragent.c
@@ -78,3 +78,13 @@ user_agent_string(void)
        return core_user_agent_string;
 }
 
+/* Public API documented in useragent.h */
+void
+free_user_agent_string(void)
+{
+       if (core_user_agent_string != NULL) {
+               /* Nasty cast because we need to de-const it to free it */
+               free((void *)core_user_agent_string);
+               core_user_agent_string = NULL;
+       }
+}
diff --git a/utils/useragent.h b/utils/useragent.h
index 87677e7..6eb309a 100644
--- a/utils/useragent.h
+++ b/utils/useragent.h
@@ -27,4 +27,11 @@
  */
 const char * user_agent_string(void);
 
+/** Free any memory allocated for the user_agent_string
+ *
+ * After calling this, the value returned by \ref user_agent_string()
+ * is to be considered invalid.
+ */
+void free_user_agent_string(void);
+
 #endif


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

Summary of changes:
 content/hlcache.c           |    3 +++
 desktop/netsurf.c           |    3 +++
 frontends/monkey/dispatch.c |   13 ++++++++++++-
 frontends/monkey/dispatch.h |    2 ++
 frontends/monkey/main.c     |    9 +++++++++
 utils/useragent.c           |   10 ++++++++++
 utils/useragent.h           |    7 +++++++
 7 files changed, 46 insertions(+), 1 deletion(-)

diff --git a/content/hlcache.c b/content/hlcache.c
index aa782b2..ec011ec 100644
--- a/content/hlcache.c
+++ b/content/hlcache.c
@@ -660,6 +660,9 @@ void hlcache_finalise(void)
        NSLOG(netsurf, INFO, "hit/miss %d/%d", hlcache->hit_count,
              hlcache->miss_count);
 
+       /* De-schedule ourselves */
+       guit->misc->schedule(-1, hlcache_clean, NULL);
+
        free(hlcache);
        hlcache = NULL;
 
diff --git a/desktop/netsurf.c b/desktop/netsurf.c
index 0928442..02080eb 100644
--- a/desktop/netsurf.c
+++ b/desktop/netsurf.c
@@ -33,6 +33,7 @@
 #include "utils/string.h"
 #include "utils/utf8.h"
 #include "utils/messages.h"
+#include "utils/useragent.h"
 #include "content/content_factory.h"
 #include "content/fetchers.h"
 #include "content/hlcache.h"
@@ -230,6 +231,8 @@ void netsurf_exit(void)
 
        NSLOG(netsurf, INFO, "Closing fetches");
        fetcher_quit();
+       /* Now the fetchers are done, our user-agent string can go */
+       free_user_agent_string();
 
        /* dump any remaining cache entries */
        image_cache_fini();
diff --git a/frontends/monkey/dispatch.c b/frontends/monkey/dispatch.c
index e60325c..08bd352 100644
--- a/frontends/monkey/dispatch.c
+++ b/frontends/monkey/dispatch.c
@@ -29,7 +29,7 @@
 
 typedef struct cmdhandler {
        struct cmdhandler *r_next, *r_prev;
-       const char *cmd;
+       char *cmd;
        handle_command_fn fn;
 } monkey_cmdhandler_t;
 
@@ -50,6 +50,17 @@ monkey_register_handler(const char *cmd, handle_command_fn 
fn)
 }
 
 void
+monkey_free_handlers(void)
+{
+       while (handler_ring != NULL) {
+               monkey_cmdhandler_t *handler = handler_ring;
+               RING_REMOVE(handler_ring, handler);
+               free(handler->cmd);
+               free(handler);
+       }
+}
+
+void
 monkey_process_command(void)
 {
        char buffer[PATH_MAX];
diff --git a/frontends/monkey/dispatch.h b/frontends/monkey/dispatch.h
index dc6e50a..11b1c02 100644
--- a/frontends/monkey/dispatch.h
+++ b/frontends/monkey/dispatch.h
@@ -25,4 +25,6 @@ nserror monkey_register_handler(const char *cmd, 
handle_command_fn fn);
 
 void monkey_process_command(void);
 
+void monkey_free_handlers(void);
+
 #endif /* NETSURF_MONKEY_DISPATCH_H */
diff --git a/frontends/monkey/main.c b/frontends/monkey/main.c
index 1e496cb..0b7efda 100644
--- a/frontends/monkey/main.c
+++ b/frontends/monkey/main.c
@@ -380,6 +380,12 @@ main(int argc, char **argv)
        urldb_load(nsoption_charp(url_file));
        urldb_load_cookies(nsoption_charp(cookie_file));
 
+       /* Free resource paths now we're done finding resources */
+       for (char **s = respaths; *s != NULL; s++) {
+               free(*s);
+       }
+       free(respaths);
+
        ret = monkey_register_handler("QUIT", quit_handler);
        if (ret != NSERROR_OK) {
                die("quit handler failed to register");
@@ -421,5 +427,8 @@ main(int argc, char **argv)
        /* finalise logging */
        nslog_finalise();
 
+       /* And free any monkey-specific bits */
+       monkey_free_handlers();
+
        return 0;
 }
diff --git a/utils/useragent.c b/utils/useragent.c
index b528dce..3d93a97 100644
--- a/utils/useragent.c
+++ b/utils/useragent.c
@@ -78,3 +78,13 @@ user_agent_string(void)
        return core_user_agent_string;
 }
 
+/* Public API documented in useragent.h */
+void
+free_user_agent_string(void)
+{
+       if (core_user_agent_string != NULL) {
+               /* Nasty cast because we need to de-const it to free it */
+               free((void *)core_user_agent_string);
+               core_user_agent_string = NULL;
+       }
+}
diff --git a/utils/useragent.h b/utils/useragent.h
index 87677e7..6eb309a 100644
--- a/utils/useragent.h
+++ b/utils/useragent.h
@@ -27,4 +27,11 @@
  */
 const char * user_agent_string(void);
 
+/** Free any memory allocated for the user_agent_string
+ *
+ * After calling this, the value returned by \ref user_agent_string()
+ * is to be considered invalid.
+ */
+void free_user_agent_string(void);
+
 #endif


-- 
NetSurf Browser

_______________________________________________
netsurf-commits mailing list
[email protected]
http://listmaster.pepperfish.net/cgi-bin/mailman/listinfo/netsurf-commits-netsurf-browser.org

Reply via email to