[osg-users] referenced memory management across dlls/exe (Windows only)

2015-02-28 Thread Trajce Nikolov NICK
Hi all,

I am facing a problem with memory clean-up when mixing the place of
allocation across dlls and the executable. Let say I have main executable
that loads dlls (plugins) in which I allocate memory using referenced
pointers. On exit, those pointers that were allocated in one of the dlls
got stucked in

if (needDelete)

{

signalObserversAndDelete(true,true);

}


Ln 198 in Referenced. And this is Windows only, on Mac or Linux I
don't have this problem.


If I clean these pointers from the originated dll, it works ok, otherwise not.


Any clue?


Thanks as allways!


Nick


-- 
trajce nikolov nick
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] referenced memory management across dlls/exe (Windows only)

2015-02-28 Thread Trajce Nikolov NICK
also I am using Qt Creator and MinGW (whatever the last version is). I know
in Visual Studio you can specify the /MD option to use shared CRT libs and
to avoid this problem. Any MinGW gurus around with hints?

Nick

On Sat, Feb 28, 2015 at 2:46 PM, Trajce Nikolov NICK 
trajce.nikolov.n...@gmail.com wrote:

 Hi all,

 I am facing a problem with memory clean-up when mixing the place of
 allocation across dlls and the executable. Let say I have main executable
 that loads dlls (plugins) in which I allocate memory using referenced
 pointers. On exit, those pointers that were allocated in one of the dlls
 got stucked in

 if (needDelete)

 {

 signalObserversAndDelete(true,true);

 }


 Ln 198 in Referenced. And this is Windows only, on Mac or Linux I don't have 
 this problem.


 If I clean these pointers from the originated dll, it works ok, otherwise not.


 Any clue?


 Thanks as allways!


 Nick


 --
 trajce nikolov nick




-- 
trajce nikolov nick
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] Fwd: Last update in the osgAnimation::Animation ONCE mode bug fix

2015-02-28 Thread Matveyev Konstantin

Konstantin Matveyev

On Nov 20, 2014, at 12:46 PM, Robert Osfield wrote:


Hi KOS,

I have just got to reviewing your proposed change to  
Animation.cpp.  What name would you like me to use when attributing  
this fix when I check it in?


Cheers,
Robert.

On 27 August 2014 13:03, Konstantin lalakos...@gmail.com wrote:


-- Forwarded message --
From: Konstantin lalakos...@gmail.com
Date: 2014-08-26 18:27 GMT+04:00
Subject: Last update in the osgAnimation::Animation ONCE mode bug fix
To: OpenSceneGraph Users osg-users@lists.openscenegraph.org, osg- 
submissi...@lists.openscenegraph.org



Hello everybody!



osgAnimation/Animation.cpp
bool Animation::update (double time, int priority)


OpenSceneGraph 3.2.1:

case ONCE:
if (t  _originalDuration)
return false;


Should be:

case ONCE:
if (t  _originalDuration)
{
for (ChannelList::const_iterator chan = _channels.begin();
 chan != _channels.end(); ++chan)
(*chan)-update(_originalDuration, _weight, priority);

return false;
}

maybe :)

KOS

___
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


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


[osg-users] Custom CompositeViewer Events

2015-02-28 Thread John Farrier
Hi,

I have a program which is using a custom viewer derived from osgViewer::View.  
In this custom view's scene may be some custom types derived from osg::Geode.  
I'll call these MyView and MyGeode for the sake of the post.  MyView's are put 
inside a osgViewer::CompositeViewer.  All this works great.  Now, I want to 
send custom events to MyView and MyGeode.  

My original hope was that I could just register a handler on MyView and MyGeode 
and do something like compositeViewer-accept(new MyEvent), but it doesn't 
seem that easy.

I ended up creating a MyCompositeViewer that has an accept function on it 
that takes MyOsgGaEventVisitor and then create a MyGUIEventHandler which 
attempts to dynamic_cast osgGA::GUIEventAdapter to MyEventAdapter.  
MyGUIEventHandler is created with a pointer to its owning MyView and then can 
make calls into MyView based on the event.  I haven't started working on 
getting the event into MyView's scene and onto MyGeode's yet because this 
design is challenging my sanity.

This approach works, but seems like a mess.  Before I get too far down this 
rabbit hole, what is the RIGHT way to get a custom event sent from a top-level 
CompositeViewer to its subordinate views and then onto the view's scene nodes?  
The examples in OSG seem to address parts of this problem, but I can't see a 
solution to the entire scope of the problem.  Another way to phrase the 
question might be:

How do I create a custom OSG-wide event that can be responded to by all 
osgViewer::View's and osg::Geode's alike?

Thank you!

Cheers,
John

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=62866#62866





___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org