Hi David,

You shouldn't need to clone the DatabasePager.  osgViewer is setup so
that the Scene object manages the scene graph and the database pager
assocaited with that scene graph.  There is one Scene object per scene
graph, and multiple views should share the same Scene instance if
there share the same scene graph.  Virtue of this sharing the Scene
shouldn't go out of scope while at lest on View still references, and
neither should its associated DatabasePager go out of scope either.

To solve this properly it'll most likely require a few tweaks to
osgViewer to handle this situation better.  Could you create an simple
example that reproduces this issue?  This could then be used as test
bed for reproducing and finally fixing it.

Robert.

On Nov 7, 2007 12:55 PM, David _ <[EMAIL PROTECTED]> wrote:
>
>  Hi Robert,
>
> problem solved!!! :)
>
> for some reason the removeView from the composite viewer is killing or doing
> something to the databasepageloader (DBP).
>
> no matter if we have 10 viewers and the reference count of the DBP is 10,
> whenever we kill any viewer by calling removeview of the composite viewer,
> the DBP stops working and sometimes is destroyed. We know this because the
> pointer to the DBP becomes useless giving us exception faults whenever we
> call any method out of it, but the reference count remains more than zero :S
>
> our solution => we did clone the DBP before calling the removeView, then
> after the removeView we call setDataBasePager(clonedDBP) for all the
> remaining viewers and is working now perfectly. The visual studio is not
> reporting any memory leaks, so i guess that the previous DBP is really being
> destroyed by the removeView call although the reference count is more than
> 1.
>
> don´t know if it´s an OSG bug or if we´re not doing something ok (probably
> the second), but it´s working fine now.
>
> thanks for the help
>
>
> > Date: Tue, 6 Nov 2007 12:50:12 +0000
>
>
> > From: [EMAIL PROTECTED]
> > To: osg-users@lists.openscenegraph.org
> > Subject: Re: [osg-users] databasepageloader and composite viewer
> >
> > Hi David,
> >
> > There a few too many parts in this set up for me to fully understand
> > the ins and outs to it I'm afraid. W.r.t. memory one needs to be
> > careful about ciruclar references i.e. the window owning the viewer vs
> > viewer owning the window. Having the GraphicsWindowWx be handled as a
> > proxy object might be the best way to tackle this, with the WxWidget
> > owning the GraphicsWindowWx and the Viewer's Camera owning
> > GraphicsWindowWx, if the WxWidget goes out of scope then the
> > GraphicsWindowWx wouldn't but would need to be switched off.
> >
> > Robert.
> >
> > On Nov 6, 2007 12:15 PM, David _ <[EMAIL PROTECTED]> wrote:
> > >
> > > Hi Robert,
> > >
> > > i´ll explaing the process we´re following and maybe you can see if we´re
> > > doing something wrong
> > >
> > > we´re using wxwidgets to manage the windows system which is composed by
> a
> > > MDI parent frame and many MDI child frames which all share the same
> parent
> > > frame.
> > >
> > > each MDI child frame (which is itself a new window) has it´s own openGL
> > > canvas and it´s own osgViewer. We also have one global compositeViewer
> for
> > > the whole application.
> > >
> > > the process we follow for creating each MDI Child Window is, create the
> new
> > > frame, create the new openglcanvas inside the new frame, create a new
> > > osgviewer, associate the osgviewer with the canvas using
> > > osg_viewer->getCamera()->setGraphicsContext(gl_canvas);, call the
> SetScene
> > > method of the viewer to tell him which scene is going to be shown and
> > > finally we call the addView method of the compositeViewer passing the
> new *
> > > viewer as a parameter
> > >
> > > for deleting the window we first use the
> > > composite_viewer->removeView(viewer) and then we delete the wxWidgets
> stuff,
> > > no direct calls to the viewer destructor is used. Does the remoview
> kills
> > > the viewer??? we believe it does because we see no memory leaks when the
> > > application closes. we´re not using a ref_ptr in the viewer because we
> had
> > > some problems with the deleting order of the widgets, we´ll try to find
> a
> > > way to use it and maybe it helps a little
> > >
> > > if you see something which you think is not right, please tell us
> > >
> > > > Date: Tue, 6 Nov 2007 11:20:57 +0000
> > >
> > >
> > > > From: [EMAIL PROTECTED]
> > > > To: osg-users@lists.openscenegraph.org
> > > > Subject: Re: [osg-users] databasepageloader and composite viewer
> > > >
> > > > Hi David,
> > > >
> > > > I've had a quick check through View.cpp and the destructor doesn't do
> > > > anything more than unref the Scene object that should be shared
> > > > between each of your views, and as such shouldn't actually do anything
> > > > to the DatabasePager directly. The same goes for
> > > > CompositeViewer::removeView, it shouldn't change anything with the
> > > > database pager directly.
> > > >
> > > > Do each of the View have their own GraphicsWindow? I wonder if this
> > > > is where the problems stem from.
> > > >
> > > > Robert.
> > > >
> > > > On Nov 6, 2007 11:12 AM, David _ <[EMAIL PROTECTED]> wrote:
> > > > >
> > > > > Hi Robert
> > > > >
> > > > > we´re currently using OSG 2.2 under windows compiled with visual
> studio
> > > 2005
> > > > >
> > > > >
> > > > > > Date: Tue, 6 Nov 2007 09:01:07 +0000
> > > > > > From: [EMAIL PROTECTED]
> > > > > > To: osg-users@lists.openscenegraph.org
> > > > > > Subject: Re: [osg-users] databasepageloader and composite viewer
> > > > >
> > > > >
> > > > > >
> > > > > > Hi David,
> > > > > >
> > > > > > Which version of the OSG are you using?
> > > > > >
> > > > > > Robert.
> > > > > >
> > > > > > On Nov 5, 2007 9:40 AM, David _ <[EMAIL PROTECTED]>
> wrote:
> > > > > > >
> > > > > > > Hi
> > > > > > >
> > > > > > > We´re dealing with a MDI application with multiple views of the
> same
> > > > > scene,
> > > > > > > which is composed by some pagelod islands.
> > > > > > >
> > > > > > > we´re using the composite viewer in order to have an independent
> > > camera
> > > > > in
> > > > > > > every child window and it´s working fine. The problem comes when
> we
> > > want
> > > > > to
> > > > > > > delete one of these windows.
> > > > > > >
> > > > > > > For deleting a view we use the removeView method of the
> composite
> > > viewer
> > > > > in
> > > > > > > order to free the osgViewer, but, sometimes it kills the
> > > > > databasepageloader
> > > > > > > too which stops all the LOD switching stuff. This is not
> happening
> > > all
> > > > > the
> > > > > > > viewers, just with some of them.
> > > > > > >
> > > > > > > How can we avoid this (killing a view of the composite viewer
> > > without
> > > > > > > killing the LOD stuff)???
> > > > > > > How can we check if the databasepageloader is gone and re-start
> it??
> > > > > > >
> > > > > > > thanks in advance
> > > > > > >
> > > > > > > help would be really appreciated
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > ________________________________
> > > > > > > Express yourself instantly with MSN Messenger! MSN Messenger
> > > > > > >
> > > > > > > _______________________________________________
> > > > > > > osg-users mailing list
> > > > > > > osg-users@lists.openscenegraph.org
> > > > > > >
> > > > >
> > >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > > > > > >
> > > > > > >
> > > > > > _______________________________________________
> > > > > > osg-users mailing list
> > > > > > osg-users@lists.openscenegraph.org
> > > > > >
> > >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > > > >
> > > > > ________________________________
> > > > > Express yourself instantly with MSN Messenger! MSN Messenger
> > > > > _______________________________________________
> > > > > osg-users mailing list
> > > > > osg-users@lists.openscenegraph.org
> > > > >
> > >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > > > >
> > > > >
> > > > _______________________________________________
> > > > osg-users mailing list
> > > > osg-users@lists.openscenegraph.org
> > > >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > >
> > > ________________________________
> > > Express yourself instantly with MSN Messenger! MSN Messenger
> > > _______________________________________________
> > > osg-users mailing list
> > > osg-users@lists.openscenegraph.org
> > >
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
> > >
> > >
> > _______________________________________________
> > osg-users mailing list
> > osg-users@lists.openscenegraph.org
> > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
> ________________________________
> Express yourself instantly with MSN Messenger! MSN Messenger
> _______________________________________________
> osg-users mailing list
> osg-users@lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
>
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to