a couple of missing pcre -> gc bindings
authorRichard Kettlewell <rjk@greenend.org.uk>
Wed, 18 Jul 2007 19:11:16 +0000 (20:11 +0100)
committerRichard Kettlewell <rjk@greenend.org.uk>
Wed, 18 Jul 2007 19:11:16 +0000 (20:11 +0100)
clients/disorder.c
disobedience/disobedience.c

index d2e3512..0ce20aa 100644 (file)
@@ -34,6 +34,7 @@
 #include <stddef.h>
 #include <unistd.h>
 #include <assert.h>
+#include <pcre.h>
 
 #include "configuration.h"
 #include "syscalls.h"
@@ -502,6 +503,9 @@ int main(int argc, char **argv) {
   struct vector args;
 
   mem_init();
+  /* garbage-collect PCRE's memory */
+  pcre_malloc = xmalloc;
+  pcre_free = xfree;
   if(!setlocale(LC_CTYPE, "")) fatal(errno, "error calling setlocale");
   while((n = getopt_long(argc, argv, "hVc:dHL", options, 0)) >= 0) {
     switch(n) {
index e0a987a..c37d0bc 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <getopt.h>
 #include <locale.h>
+#include <pcre.h>
 
 /* Apologies for the numerous de-consting casts, but GLib et al do not seem to
  * have heard of const. */
@@ -320,6 +321,9 @@ int main(int argc, char **argv) {
   disorder_eclient *logclient;
 
   mem_init();
+  /* garbage-collect PCRE's memory */
+  pcre_malloc = xmalloc;
+  pcre_free = xfree;
   if(!setlocale(LC_CTYPE, "")) fatal(errno, "error calling setlocale");
   gtk_init(&argc, &argv);
   gtk_rc_parse_string(style);