From 599c6559d60f9e6fdf88cb19bfced95843614874 Mon Sep 17 00:00:00 2001 From: danj Date: Thu, 4 May 2006 19:45:23 +0000 Subject: [PATCH] fix aproc initialization --- bdb.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/bdb.c b/bdb.c index be8e4e4..35cda6e 100644 --- a/bdb.c +++ b/bdb.c @@ -1,3 +1,10 @@ +/* + * Ruby library that wraps the Sleepycat Berkeley DB. + * + * Developed against 4.3/4.4. No support for prior versions. + * + */ + #include #include @@ -96,7 +103,7 @@ static void db_free(t_dbh *dbh) static void db_mark(t_dbh *dbh) { - if ( dbh->aproc ) + if ( ! NIL_P(dbh->aproc) ) rb_gc_mark(dbh->aproc); if ( dbh->env ) rb_gc_mark(dbh->env->self); @@ -159,6 +166,7 @@ VALUE db_init_aux(VALUE obj,t_envh * eh) dbh->db=db; dbh->self=obj; dbh->env=eh; + dbh->aproc=Qnil; memset(&(dbh->filename),0,FNLEN+1); if (eh) { @@ -309,7 +317,7 @@ VALUE db_close(VALUE obj, VALUE vflags) raise_error(rv, "db_close failure: %s",db_strerror(rv)); } dbh->db=NULL; - dbh->aproc=(VALUE)NULL; + dbh->aproc=Qnil; if ( dbh->env ) { rb_ary_delete(dbh->env->adb,obj); } @@ -1961,6 +1969,13 @@ VALUE txn_set_timeout(VALUE obj, VALUE vtimeout, VALUE vflags) return Qtrue; } +/* + * Document-class: Bdb + * + * Ruby library that wraps the Sleepycat Berkeley DB. + * + * Developed against 4.3/4.4. No support for prior versions. + */ void Init_bdb2() { fv_call=rb_intern("call");