[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Patch: readline history not cleared on exit -> memleak
From: |
Matthias Koeppe |
Subject: |
Patch: readline history not cleared on exit -> memleak |
Date: |
26 Mar 2001 19:24:01 +0200 |
User-agent: |
Gnus/5.0808 (Gnus v5.8.8) Emacs/20.6 |
I received the following patch against Guile from Utz-Uwe Haus
<address@hidden>.
2001-03-14 Utz-Uwe Haus <address@hidden>
* readline.c (scm_clear_history): New function.
* readline.scm (readline-port): Call clear-history on exit. This
removes a memory leak.
--- /home/mkoeppe/s/guile-core/guile-readline/readline.scm Mon Feb 5
15:23:08 2001
+++ readline.scm Wed Mar 14 16:33:53 2001
@@ -130,7 +130,9 @@
(begin
(do read-history)
(set! the-readline-port (make-readline-port))
- (add-hook! exit-hook (lambda () (do write-history)))))
+ (add-hook! exit-hook (lambda ()
+ (do write-history)
+ (clear-history)))))
the-readline-port)))
;;; The user might try to use readline in his programs. It then
--- /home/mkoeppe/s/guile-core/guile-readline/readline.c Fri Nov 24
12:30:07 2000
+++ readline.c Wed Mar 14 16:32:28 2001
@@ -359,6 +359,16 @@
}
#undef FUNC_NAME
+SCM_DEFINE (scm_clear_history, "clear-history", 0, 0, 0,
+ (SCM file),
+"")
+#define FUNC_NAME s_scm_clear_history
+{
+ clear_history();
+ return SCM_UNSPECIFIED;
+}
+#undef FUNC_NAME
+
SCM_DEFINE (scm_filename_completion_function, "filename-completion-function",
2, 0, 0,
(SCM text, SCM continuep),
--
Matthias Köppe -- http://www.math.uni-magdeburg.de/~mkoeppe
- Patch: readline history not cleared on exit -> memleak,
Matthias Koeppe <=