<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -99,6 +99,7 @@ VALUE am_sqlite3_database_close(VALUE self)
 
     Data_Get_Struct(self, am_sqlite3, am_db);
     rc = sqlite3_close( am_db-&gt;db );
+    am_db-&gt;db = NULL;
     if ( SQLITE_OK != rc ) {
         rb_raise(eAS_Error, &quot;Failure to close database : [SQLITE_ERROR %d] : %s\n&quot;,
                 rc, sqlite3_errmsg( am_db-&gt;db ));
@@ -1050,7 +1051,7 @@ VALUE am_sqlite3_database_table_column_metadata(VALUE self, VALUE db_name, VALUE
 
 /*
  * garbage collector free method for the am_data structure.  Make sure to un
- * registere the trace and profile objects if they are not Qnil
+ * register the trace and profile objects if they are not Qnil
  */
 void am_sqlite3_database_free(am_sqlite3* am_db)
 {
@@ -1073,8 +1074,7 @@ void am_sqlite3_database_free(am_sqlite3* am_db)
         rb_gc_unregister_address( &amp;(am_db-&gt;progress_handler_obj) );
         am_db-&gt;progress_handler_obj = Qnil;
     }
-
-
+    am_db-&gt;db = NULL;
 
     free(am_db);
     return;
@@ -1092,6 +1092,7 @@ VALUE am_sqlite3_database_alloc(VALUE klass)
     am_db-&gt;profile_obj          = Qnil;
     am_db-&gt;busy_handler_obj     = Qnil;
     am_db-&gt;progress_handler_obj = Qnil;
+    am_db-&gt;db                   = NULL;
 
     obj = Data_Wrap_Struct(klass, NULL, am_sqlite3_database_free, am_db);
     return obj;</diff>
      <filename>ext/amalgalite/amalgalite3_database.c</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>b74757321f2b3346522cd84286a6e83d1b00a986</id>
    </parent>
  </parents>
  <author>
    <name>Jeremy Hinegardner</name>
    <email>jeremy@copiousfreetime.org</email>
  </author>
  <url>http://github.com/copiousfreetime/amalgalite/commit/76c69a061bec00ac0d806ea0e16f47cf6f5a7a8c</url>
  <id>76c69a061bec00ac0d806ea0e16f47cf6f5a7a8c</id>
  <committed-date>2009-10-27T22:05:31-07:00</committed-date>
  <authored-date>2009-10-27T22:05:31-07:00</authored-date>
  <message>ensure db pointer after deallocating ruby object</message>
  <tree>b71e7178a6faff4af7f56ce0fe5bd2c389610afb</tree>
  <committer>
    <name>Jeremy Hinegardner</name>
    <email>jeremy@copiousfreetime.org</email>
  </committer>
</commit>
