em would now be less complete ;-)
Chris.
Date: Tue, 18 Nov 2008 23:37:00 +
From: "Simon Hammett" <[EMAIL PROTECTED]>
Subject: Re: [osg-users] A very simple ref_ptr memory leak example.
To: "OpenSceneGraph Users"
Message-ID:
<[EMAIL PROTECTED]>
Content-Type: tex
2008/11/18 Chris Denham <[EMAIL PROTECTED]>:
> Thanks for the tips everyone.
> I suppose as Paul suggests, it's best to avoid doing things that hurt.
> The problem is that when we accidentally implemented this pattern in a
> more complex application, it was a bit fiddly to track down. I only
> noti
-0700
From: "Paul Martz" <[EMAIL PROTECTED]>
Subject: Re: [osg-users] A very simple ref_ptr memory leak example.
To: "'OpenSceneGraph Users'"
Message-ID: <[EMAIL PROTECTED]>
Content-Type: text/plain; charset="us-ascii"
> Using ref_ptr's is fa
> The posted code would behave the same for any type of reference-counted
> memory management system, I imagine, so isn't really an issue with OSG
> ref_ptr<> classes. It's simply an aspect of the algorithm, which programmers
> must be aware of and be careful to avoid.
>
> Or, to put it another way
> Using ref_ptr's is far cheaper than a garbage collector we
> don't have (... until ISO C++ 2009 ?).
> osg::observer_ptr<> could be used to solve the problem, but
> you can also simply try to avoid circular references... how ?
> Well, you could try to define an object to be "slave" of
> anothe
Hi Chris,
Using ref_ptr's is far cheaper than a garbage collector we don't have (...
until ISO C++ 2009 ?).
osg::observer_ptr<> could be used to solve the problem, but you can also simply
try to avoid circular references... how ? Well, you could try to define an
object to be "slave" of another
rs"
Sent: Tuesday, November 18, 2008 5:37 PM
Subject: Re: [osg-users] A very simple ref_ptr memory leak example.
What compiler are you using? The snippet doesn't compile for me with gcc
4.1.2.
It's not hard indeed to create cycles, and handling them robustly would
mean checkin
What compiler are you using? The snippet doesn't compile for me with gcc
4.1.2.
It's not hard indeed to create cycles, and handling them robustly would
mean checking for every reference stored in a Referenced instance if
there isn't a cycle.
Which is not impossible, but adds a lot of overhead I s
tr, so I'm having a look at that. Looks
like it may be the ticket!
Cheers.
Chris.
- Original Message -
From: Enrique Parodi
To: Chris Denham ; OpenSceneGraph Users
Sent: Tuesday, November 18, 2008 5:26 PM
Subject: Re: [osg-users] A very simple ref_ptr memory leak example
Try using virtual protected destructors
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
I'm probably treading very old ground here to do with circular usage of
ref_ptr, but it's new to me and I couldn't find any references in the mail
archive about users with similar problems.
I have pasted below, a very simple example of my usage of ref_ptr that leaks
memory.
I can see why it leak
11 matches
Mail list logo