Here is a patch that fixes this up.

-Allen

On Sat, Mar 21, 2009 at 5:06 AM, Gerrit Voß <[email protected]> wrote:
>
> Hi,
>
> On Fri, 2009-03-20 at 11:47 -0500, Allen Bierbaum wrote:
>> Looks like the code I added for MTWeakPtr is not working correctly.  I
>> have looked through the code and I can't see the issue.
>
> you only do the validation for the MT part but not the validation for
> the Weak part so that is why you still get a 'seemingly' valid pointer.
>
> You should do something like
>
> T *retVal = convertToCurrentAspect(pObject);
>
> return Inherited::validate(retVal);
>
> kind regards,
>  gerrit
>
>
>
> ------------------------------------------------------------------------------
> Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
> powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
> easily build your RIAs with Flex Builder, the Eclipse(TM)based development
> software that enables intelligent coding and step-through debugging.
> Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
> _______________________________________________
> Opensg-core mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/opensg-core
>
Index: Source/Base/FieldContainer/Base/OSGRefCountPolicies.h
===================================================================
--- Source/Base/FieldContainer/Base/OSGRefCountPolicies.h       (revision 1831)
+++ Source/Base/FieldContainer/Base/OSGRefCountPolicies.h       (working copy)
@@ -288,7 +288,8 @@
     template <class T>
     static T *validate   (T *pObject)
     {
-        return convertToCurrentAspect(pObject);
+        T* retVal = convertToCurrentAspect(pObject);
+        return WeakRefCountPolicy::validate(retVal);
     }
 
     template <class T>
------------------------------------------------------------------------------
Apps built with the Adobe(R) Flex(R) framework and Flex Builder(TM) are
powering Web 2.0 with engaging, cross-platform capabilities. Quickly and
easily build your RIAs with Flex Builder, the Eclipse(TM)based development
software that enables intelligent coding and step-through debugging.
Download the free 60 day trial. http://p.sf.net/sfu/www-adobe-com
_______________________________________________
Opensg-core mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-core

Reply via email to