2004-08-01 Han-Wen Nienhuys <hanwen@xs4all.nl>
+ * lily/my-lily-parser.cc (LY_DEFINE): plug memory leak: unprotect
+ parser.
+
+ * lily/include/my-lily-lexer.hh (class Lily_lexer): smobify lexer.
+
* lily/include/my-lily-parser.hh: rename My_lily -> Lily
* make/mutopia-targets.make (local-WWW): don't make ps.gz
- examples. They take huge amounts of space.
+ examples. They take a huge amount of space.
* Documentation/user/GNUmakefile: fix symlinks.
Lily_parser::parse_file (String init, String name, String out_name)
{
lexer_ = new Lily_lexer (sources_);
+ scm_gc_unprotect_object (lexer_->self_scm ());
// TODO: use $parser
lexer_->set_identifier (ly_symbol2scm ("parser"),
self_scm ());
}
error_level_ = error_level_ | lexer_->error_level_;
-
- scm_gc_unprotect_object (lexer_->self_scm ());
lexer_ = 0;
}
Lily_lexer *parent = lexer_;
lexer_ = (parent == 0 ? new Lily_lexer (sources_)
: new Lily_lexer (*parent));
+ scm_gc_unprotect_object (lexer_->self_scm ());
SCM oldmod = scm_current_module ();
}
scm_set_current_module (oldmod);
- scm_gc_unprotect_object (lexer_->self_scm ());
lexer_ = 0;
}
parser->parse_file (init, file_name, out_file);
bool error = parser->error_level_;
+ scm_gc_unprotect_object (parser->self_scm ());
parser = 0;
if (error)
/* TODO: pass renamed input file too. */
scm_module_define (global_lily_module, ly_symbol2scm ("parser"),
parser->self_scm ());
parser->parse_string (ly_scm2string (ly_code));
+ scm_gc_unprotect_object (parser->self_scm ());
parser = 0;
return SCM_UNSPECIFIED;
(outfile (open-file (string-append
"gcstat-" (number->string gc-protect-stat-count)
".scm"
- ) "w"))
- )
+ ) "w")))
(display "DUMPING...\n")
(display
(let* ((failed '())
(handler (lambda (key arg) (set! failed (cons arg failed)))))
(for-each
- (lambda (f) (catch 'ly-file-failed (lambda () (ly:parse-file f)) handler))
+ (lambda (f)
+ (catch 'ly-file-failed (lambda () (ly:parse-file f)) handler)
+ (dump-gc-protects)
+ )
files)
(if (pair? failed)