-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Dominic Mitchell wrote:
> We are passing these objects as arguments into components.
>    <& "/some/component", search => $myobj &>
> 
> I've recently upgraded one of our sites from Mason 1.28 to 1.33 and
> discovered that these objects are not getting destroyed properly.  I
> added some logging to the destructor and it was not being terminated at
> the correct point.  Instead of going out of scope at the end of the
> component which created the object, it's being destroyed at the end of
> the request (or not all in some cases, which I don't understand).

I remember I had this problem long time ago, but I what I don't really
remember is how I solved it. It was either by wrapping arguments in a
suplementary "wrapper" like:
  <& "/some/component", wrap => { search => $myobj } &>
or by weakening those objects ( weaken($myobj) ).

> I've produced a patch (attached) which corrects this for my situation,
> but it makes lots of tests fail.  I haven't looked at why yet.
I reckon localizing $m->{stack} will make things even worse, as it is
used internally by many Mason methods.

> Does any of this make sense?  Am I barking up the wrong tree?  Is this a
> bug in Mason, or am I doing something stupid?
There are way too many ways of getting a weak ref strong again, so OFC,
it could be possible. Either way, I'd like to see a test case :)

By baking simple test cases I often found out that in fact there were
"my bugs" instead "mason bugs". Let's hope you'll get to the same
conclusion, for the sake of all masonites ;-)

cheers
- --
Marius Feraru
-----BEGIN PGP SIGNATURE-----

iD8DBQFFEoS+tZHp/AYZiNkRAm0WAJsFgSCY4rdD1HTmvFbwCH4FFHL8ZgCg7SlZ
gFrTprfaPS448aGbn8wxjWA=
=jQO2
-----END PGP SIGNATURE-----

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
Mason-users mailing list
Mason-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mason-users

Reply via email to