Hello Johannes,
Johannes Brunen wrote:
> I have a little issue with the implementation of the navigator. In case
> that the user does provide its own NavigatorEngine, the lifetime
> management is disturbed. In that case the user's client code is
> responsible for creation of the object but the Navigator class does
> actually perform the deletion of the object. Since this typically
> happens in a different runtime context (exe, dll) their are possibly
> different memory handler performing the actual task. This would be a
> problem.
NavigatorEngine derives from MemoryObject out base type for ref counted
objects (that are not FieldContainer). The navigator only decrements the
ref count in its d'tor.
How does this work for all the other ref counted objects?
> Is it possible to handle the NavigatorEngine objects by boost shared
> pointers inside the Navigator, which (imho) do not show this problem?
hm, how would that be any different? Even if you use a custom deleter
(not sure if that is the right boost terminology) it would still execute
from the Navigators d'tor.
> Another possibility would be to not manage the lifetime of the user
> defined NavigatorEngine objects but leave it in the client code.
Perhaps your client code can keep a reference to the NavigatorEngine and
you could make sure that it is only given up after the Navigator itself
is destroyed?
Cheers,
Carsten
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users