Author: timbo
Date: Tue Jun 21 13:35:02 2005
New Revision: 1085

Modified:
   dbi/trunk/Changes
   dbi/trunk/DBI.xs
Log:
Fixed dangling ref in $sth after parent $dbh destroyed
with thanks to [EMAIL PROTECTED] for the bug report #13151


Modified: dbi/trunk/Changes
==============================================================================
--- dbi/trunk/Changes   (original)
+++ dbi/trunk/Changes   Tue Jun 21 13:35:02 2005
@@ -12,6 +12,8 @@ DBI::Changes - List of significant chang
   Fixed bugs in DBD::DBM thanks to Jeff Zucker.
   Fixed bug in DBI::ProfileDumper thanks to Sam Tregar.
   Fixed ping in DBD::Proxy thanks to George Campbell.
+  Fixed dangling ref in $sth after parent $dbh destroyed
+    with thanks to [EMAIL PROTECTED] for the bug report #13151
 
   Changed internals to be more strictly coded thanks to Andy Lester.
   Changed warning about multiple copies of Driver.xst found in @INC

Modified: dbi/trunk/DBI.xs
==============================================================================
--- dbi/trunk/DBI.xs    (original)
+++ dbi/trunk/DBI.xs    Tue Jun 21 13:35:02 2005
@@ -2388,6 +2388,12 @@ XS(XS_DBI_dispatch)         /* prototype
                );
            /* for now we ignore it since it'll be followed soon by     */
            /* a destroy of the inner hash and that'll do the real work */
+
+           /* However, we must at least modify DBIc_MY_H() as that is  */
+           /* pointing (without a refcnt inc) to the scalar that is    */
+           /* being destroyed, so it'll contain random values later.   */
+           DBIc_MY_H(imp_xxh) = SvRV(mg->mg_obj); /* inner (untied) HV */
+
            XSRETURN(0);
        }
         h = mg->mg_obj; /* switch h to inner ref                       */

Reply via email to