[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 1/12] Guile-DBI: Avoid multiple init
From: |
Linas Vepstas |
Subject: |
[PATCH 1/12] Guile-DBI: Avoid multiple init |
Date: |
Fri, 19 Sep 2008 09:00:15 -0500 |
User-agent: |
Mutt/1.5.15+20070412 (2007-04-11) |
If (use-modules (dbi dbi)) is called multiple times, then guile
will crash in various strange ways, often during garbage-collection.
Thus, avoid initializaing more than once.
From: Linas Vepstas <address@hidden>
---
src/guile-dbi.c | 3 +++
1 file changed, 3 insertions(+)
Index: guile-dbi-2.0.0/src/guile-dbi.c
===================================================================
--- guile-dbi-2.0.0.orig/src/guile-dbi.c 2008-09-15 13:03:05.000000000
-0500
+++ guile-dbi-2.0.0/src/guile-dbi.c 2008-09-15 13:19:36.000000000 -0500
@@ -295,6 +295,9 @@ init_db_handle_type(void)
void
init_dbi(void)
{
+ static int is_inited = 0;
+ if (is_inited) return;
+ is_inited = 1;
init_db_handle_type();
#ifndef SCM_MAGIC_SNARFER
signature.asc
Description: Digital signature
- PATCH [0/12]: Guile-DBI and Guile-DBD-Postgres, Linas Vepstas, 2008/09/19
- [PATCH 1/12] Guile-DBI: Avoid multiple init,
Linas Vepstas <=
- [PATCH 2/12] Guile-DBI: minor cleanup, Linas Vepstas, 2008/09/19
- [PATCH 3/12] Guile-DBI: Fix memory leak, Linas Vepstas, 2008/09/19
- [PATCH 4/12] Guile-DBII: replace deprecated gh_ functions, Linas Vepstas, 2008/09/19
- [PATCH 6/12] Guile-DBI: Fix crash, avoid recursive free, Linas Vepstas, 2008/09/19
- [PATCH 5/12] Guile-DBI: Use remember_upto_here, Linas Vepstas, 2008/09/19
- [PATCH 7/12] Guile-DBI: Don't cast away const, Linas Vepstas, 2008/09/19
- [PATCH 8/12] Guile-DBD-postgres: Fix handling of float point columns, Linas Vepstas, 2008/09/19
- [PATCH 9/12] Guile-DBD-postgres: Avoid discouraged functions, Linas Vepstas, 2008/09/19
- [PATCH 10/12] Guile-DBD-postgres: Fix off-by-one when fetching rows, Linas Vepstas, 2008/09/19
- [PATCH 11/12] Guile-DBD-postgres: Avoid deprecated functions, Linas Vepstas, 2008/09/19