aboutsummaryrefslogtreecommitdiffstats
path: root/e-util
diff options
context:
space:
mode:
authorNot Zed <NotZed@HelixCode.com>2000-11-29 18:29:56 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-11-29 18:29:56 +0800
commitfe151f15997c2130bf5f71c752a960de05a1bf6b (patch)
treebdb23e058c58579b32405fa407f38f3160262a17 /e-util
parent0a68cff31e3ee31622eb328de3afbeaf872b1c21 (diff)
downloadgsoc2013-evolution-fe151f15997c2130bf5f71c752a960de05a1bf6b.tar.gz
gsoc2013-evolution-fe151f15997c2130bf5f71c752a960de05a1bf6b.tar.zst
gsoc2013-evolution-fe151f15997c2130bf5f71c752a960de05a1bf6b.zip
Plug a memleak, need to free results from term_eval(). (term_eval_gt):
2000-11-29 Not Zed <NotZed@HelixCode.com> * e-sexp.c (term_eval_lt): Plug a memleak, need to free results from term_eval(). (term_eval_gt): (term_eval_eq): 2000-11-27 Not Zed <NotZed@HelixCode.com> * e-memory.c (e_mempool_new): Added some locking to global data. This should make the interfaces mt-safe, although each object is only per-thread safe. svn path=/trunk/; revision=6710
Diffstat (limited to 'e-util')
-rw-r--r--e-util/ChangeLog13
-rw-r--r--e-util/e-memory.c9
-rw-r--r--e-util/e-sexp.c6
3 files changed, 28 insertions, 0 deletions
diff --git a/e-util/ChangeLog b/e-util/ChangeLog
index 1494b6130b..b45ffddc82 100644
--- a/e-util/ChangeLog
+++ b/e-util/ChangeLog
@@ -1,3 +1,16 @@
+2000-11-29 Not Zed <NotZed@HelixCode.com>
+
+ * e-sexp.c (term_eval_lt): Plug a memleak, need to free results
+ from term_eval().
+ (term_eval_gt):
+ (term_eval_eq):
+
+2000-11-27 Not Zed <NotZed@HelixCode.com>
+
+ * e-memory.c (e_mempool_new): Added some locking to global data.
+ This should make the interfaces mt-safe, although each object is
+ only per-thread safe.
+
2000-11-22 Not Zed <NotZed@HelixCode.com>
* e-memory.c (e_mempool_alloc): If we dont get a big enough chunk
diff --git a/e-util/e-memory.c b/e-util/e-memory.c
index e8e52fdb5c..1c3958b6f3 100644
--- a/e-util/e-memory.c
+++ b/e-util/e-memory.c
@@ -336,6 +336,9 @@ typedef struct _EMemPool {
/* a pool of mempool header blocks */
static MemChunk *mempool_memchunk;
+#ifdef G_THREADS_ENABLED
+static GStaticMutex mempool_mutex = G_STATIC_MUTEX_INIT;
+#endif
/**
* e_mempool_new:
@@ -363,10 +366,16 @@ MemPool *e_mempool_new(int blocksize, int threshold, EMemPoolFlags flags)
{
MemPool *pool;
+#ifdef G_THREADS_ENABLED
+ g_static_mutex_lock(&mempool_mutex);
+#endif
if (mempool_memchunk == NULL) {
mempool_memchunk = e_memchunk_new(8, sizeof(MemPool));
}
pool = e_memchunk_alloc(mempool_memchunk);
+#ifdef G_THREADS_ENABLED
+ g_static_mutex_unlock(&mempool_mutex);
+#endif
if (threshold >= blocksize)
threshold = blocksize * 2 / 3;
pool->blocksize = blocksize;
diff --git a/e-util/e-sexp.c b/e-util/e-sexp.c
index 2757ea2043..08b9bb6a62 100644
--- a/e-util/e-sexp.c
+++ b/e-util/e-sexp.c
@@ -320,6 +320,8 @@ term_eval_lt(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
r->type = ESEXP_RES_BOOL;
r->value.bool = strcmp(r1->value.string, r2->value.string) < 0;
}
+ e_sexp_result_free(r1);
+ e_sexp_result_free(r2);
}
return r;
}
@@ -344,6 +346,8 @@ term_eval_gt(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
r->type = ESEXP_RES_BOOL;
r->value.bool = strcmp(r1->value.string, r2->value.string) > 0;
}
+ e_sexp_result_free(r1);
+ e_sexp_result_free(r2);
}
return r;
}
@@ -368,6 +372,8 @@ term_eval_eq(struct _ESExp *f, int argc, struct _ESExpTerm **argv, void *data)
} else if (r1->type == ESEXP_RES_STRING) {
r->value.bool = strcmp(r1->value.string, r2->value.string) == 0;
}
+ e_sexp_result_free(r1);
+ e_sexp_result_free(r2);
}
return r;
}
e-3.28&id=b227b572d808bc9da030a9f4a079976d44caca94'>- Remove WITH_FBSD10_FIX, is no longer neededmiwi2011-11-091-1/+0 * - Fix build on FreeBSD 10miwi2011-10-291-0/+1 * Remove more tags from pkg-descr files fo the form:dougb2011-10-241-3/+0 * big WorldForge update:oliver2011-04-293-4/+4 * - Get Rid MD5 supportmiwi2011-03-201-1/+0 * update wfmath to 0.3.10oliver2010-01-022-4/+4