[prev in list] [next in list] [prev in thread] [next in thread] 

List:       gtkmm
Subject:    Re: boost::shared_ptr weirdness
From:       Rob Benton <rob.benton () conwaycorp ! net>
Date:       2005-10-22 18:22:11
Message-ID: 435A9445.8060506 () conwaycorp ! net
[Download RAW message or body]

Murray Cumming wrote:
>>Paul Davis <pjdavis@engineering.uiowa.edu> writes:
>>
>>
>>>Has anyone ever noticed weird behavior with boost::shared_ptrs and
>>>widgets?  I've been getting some random segfaults when closing my
>>>programs.  They seem to be coming from removing a container that
>>>contains a widget that is a member of an object referenced by a
>>>shared_ptr.  I think.  I haven't gotten it to be reproducible.  I'm
>>>just using this as a shot in the dark to see if there are documented
>>>no-no's for using boost's shared pointers or something.
>>
>>
>>boost::shared_ptr<> is not thread safe. Other than that, they behave
>>like any other object. I tend to use Glib::RefPtr<> in gtkmm code
>>and boost::shared_ptr<> in libs and other non UI dependent code.
> 
> 
> valgrind's memcheck is incredibly useful for these kinds of problems.
> 
> Murray Cumming
> murrayc@murrayc.com
> www.murrayc.com
> www.openismus.com
> 
> _______________________________________________
> gtkmm-list mailing list
> gtkmm-list@gnome.org
> http://mail.gnome.org/mailman/listinfo/gtkmm-list
> 
> 

The docs have a note on threads although I can't speak for it since I've 
never tested it:

http://www.boost.org/libs/smart_ptr/shared_ptr.htm#ThreadSafety
_______________________________________________
gtkmm-list mailing list
gtkmm-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtkmm-list
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic