chiark / gitweb /
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 d2e35126b7df673617d097b2fab6cdbd93e1677b..0ce20aa271ba5ec53a27a5e76cda4ebd28a7715d 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 e0a987aa746f96f5cd0983cebc30bbe0e9c3cf25..c37d0bcf82aace38ea037b3711ca3de07c870f5c 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);