* apply to closures generated within eval"", since eval"" CVs are
* ephemeral. --GSAR */
if (!CvANON(cv) || CvCLONED(cv)
- || (CvOUTSIDE(cv) && CvEVAL(CvOUTSIDE(cv)) && !CvGV(CvOUTSIDE(cv))))
+ || (CvOUTSIDE(cv) && SvTYPE(CvOUTSIDE(cv)) == SVt_PVCV
+ && CvEVAL(CvOUTSIDE(cv)) && !CvGV(CvOUTSIDE(cv))))
{
SvREFCNT_dec(CvOUTSIDE(cv));
}
* lifetime of the outer CV. Avoids memory leak due to reference
* loop. --GSAR */
if (!name && CvOUTSIDE(cv)
- && !(CvEVAL(CvOUTSIDE(cv)) && !CvGV(CvOUTSIDE(cv))))
+ && !(SvTYPE(CvOUTSIDE(cv)) == SVt_PVCV
+ && CvEVAL(CvOUTSIDE(cv)) && !CvGV(CvOUTSIDE(cv))))
{
SvREFCNT_dec(CvOUTSIDE(cv));
}