wxDC usage in a thread

Vadim Zeitlin vadim at wxwidgets.org
Wed Feb 6 06:02:46 PST 2008


On Wed, 06 Feb 2008 14:31:11 +0100 Harry <"harry dot news at armadillo dot fr"@a.mx.sunsite.dk> wrote:

H> which specifies the following member initialization:
H>         , m_backgroundBrush(*wxTRANSPARENT_BRUSH)
H> 
H> As the stock item wxTRANSPARENT_BRUSH is probably already allocated by 
H> and used by
H> the main thread, its concurrent usage from a thread may destroy its 
H> reference counting,
H> since reference counting isn't thread-safe.
H> 
H> I've solved the problem by replacing this member initialization by:
H>         , m_backgroundBrush()
H> 
H> Does anybody have an objection to this, before I contribute it as a patch ?

 Are you sure that this doesn't result in any changes in the behaviour?
I.e. is invalid brush treated the same as transparent one everywhere? I
don't think so but I might be missing something...

 Regards,
VZ

-- 
TT-Solutions: wxWidgets consultancy and technical support
               http://www.tt-solutions.com/





More information about the wx-users mailing list